File tree Expand file tree Collapse file tree 3 files changed +15
-8
lines changed Expand file tree Collapse file tree 3 files changed +15
-8
lines changed Original file line number Diff line number Diff line change 1313import com .frank .ffmpeg .R ;
1414import com .frank .ffmpeg .handler .FFmpegHandler ;
1515
16+ import com .frank .ffmpeg .model .MediaBean ;
17+ import com .frank .ffmpeg .tool .JsonParseTool ;
1618import com .frank .ffmpeg .util .FFmpegUtil ;
1719import com .frank .ffmpeg .util .FileUtil ;
1820
@@ -44,9 +46,10 @@ public void handleMessage(Message msg) {
4446 case MSG_FINISH :
4547 progressProbe .setVisibility (View .GONE );
4648 layoutProbe .setVisibility (View .VISIBLE );
47- String result = (String ) msg .obj ;
48- if (!TextUtils .isEmpty (result ) && txtProbeFormat != null ) {
49- txtProbeFormat .setText (result );
49+ MediaBean result = (MediaBean ) msg .obj ;
50+ String resultFormat = JsonParseTool .stringFormat (result );
51+ if (!TextUtils .isEmpty (resultFormat ) && txtProbeFormat != null ) {
52+ txtProbeFormat .setText (resultFormat );
5053 }
5154 break ;
5255 default :
Original file line number Diff line number Diff line change 55
66import com .frank .ffmpeg .FFmpegCmd ;
77import com .frank .ffmpeg .listener .OnHandleListener ;
8+ import com .frank .ffmpeg .model .MediaBean ;
9+ import com .frank .ffmpeg .tool .JsonParseTool ;
810
911/**
1012 * Handler消息处理器
@@ -78,12 +80,12 @@ public void onBegin() {
7880
7981 @ Override
8082 public void onEnd (int resultCode , String resultMsg ) {
81- Log .e (TAG , "handle ffprobe onEnd result=" + resultMsg );
82- if (isContinue ) {
83- mHandler .obtainMessage (MSG_CONTINUE ).sendToTarget ();
84- }else {
85- mHandler .obtainMessage (MSG_FINISH , resultMsg ).sendToTarget ();
83+ Log .i (TAG , "handle ffprobe onEnd result=" + resultMsg );
84+ MediaBean mediaBean = null ;
85+ if (resultMsg != null && !resultMsg .isEmpty ()) {
86+ mediaBean = JsonParseTool .parseMediaFormat (resultMsg );
8687 }
88+ mHandler .obtainMessage (MSG_FINISH , mediaBean ).sendToTarget ();
8789 }
8890 });
8991 }
Original file line number Diff line number Diff line change 2121 android : layout_width =" wrap_content"
2222 android : layout_height =" wrap_content"
2323 android : layout_marginTop =" 20dp"
24+ android : textColor =" @color/colorPrimary"
25+ android : textSize =" 16sp"
2426 android : layout_below =" @+id/btn_probe_format"
2527 android : layout_centerHorizontal =" true" />
2628 </RelativeLayout >
You can’t perform that action at this time.
0 commit comments