fixed pvs issues 75/142675/2 accepted/tizen/4.0/unified/20170828.224043 accepted/tizen/unified/20170808.171513 submit/tizen/20170808.044209 submit/tizen_4.0/20170828.100002
authorSejun Park <sejun79.park@samsung.com>
Mon, 7 Aug 2017 04:14:21 +0000 (13:14 +0900)
committerSejun Park <sejun79.park@samsung.com>
Mon, 7 Aug 2017 04:17:46 +0000 (13:17 +0900)
Change-Id: I25db77a3ab066ea0a82c963a54af08021f20ae91

src/media_codec_port_gst.c
test/media_codec_test.c

index 83ab219..daa574f 100644 (file)
@@ -2421,7 +2421,10 @@ ERROR:
 
 void _mc_gst_handle_input_buffer_used(mc_gst_core_t *core, media_packet_h packet)
 {
-       g_atomic_int_dec_and_test(&core->etb_count);
+       if (core) {
+               g_atomic_int_dec_and_test(&core->etb_count);
+               LOGD("@v(%d)e(%d) input port used(%d)----- ", core->video, core->encoder, core->etb_count);
+       }
 
        if (core && core->user_cb[_MEDIACODEC_EVENT_TYPE_EMPTYBUFFER]) {
                ((mc_empty_buffer_cb)core->user_cb[_MEDIACODEC_EVENT_TYPE_EMPTYBUFFER])
@@ -2863,8 +2866,6 @@ static gint __gst_transform_gsterror(mc_gst_core_t *core, GstMessage *message, G
                break;
        }
 
-       return MEDIACODEC_ERROR_INVALID_STREAM;
-
 INTERNAL_ERROR:
        return MEDIACODEC_ERROR_INTERNAL;
 }
index 80e6c60..005d4f3 100644 (file)
@@ -855,7 +855,7 @@ int  _configure(App *app, int codecid, int flag, gboolean *hardware, media_forma
 
 void _mediacodec_process_input(App *app)
 {
-       gint i;
+       gint i, j;
        gboolean have_frame = FALSE;
        gint ret;
        static guint64 pts = 0L;
@@ -902,7 +902,7 @@ void _mediacodec_process_input(App *app)
                                media_packet_get_video_stride_width(pkt, 0, &stride_width);
                                offset = app->width*app->height;
 
-                               for (i = 0; i < app->height; i++) {
+                               for (j = 0; j < app->height; j++) {
                                        memcpy(buf_data_ptr, tmp, app->width);
                                        buf_data_ptr += stride_width;
                                        tmp += app->width;
@@ -913,7 +913,7 @@ void _mediacodec_process_input(App *app)
                                        media_packet_get_video_stride_width(pkt, 1, &stride_width);
                                        size = app->width * app->height / 2;
 
-                                       for (i = 0; i < app->height / 2; i++) {
+                                       for (j = 0; j < app->height / 2; j++) {
                                                memcpy(buf_data_ptr, tmp, app->width);
                                                buf_data_ptr += stride_width;
                                                tmp += app->width;
@@ -924,7 +924,7 @@ void _mediacodec_process_input(App *app)
                                        media_packet_get_video_stride_width(pkt, 1, &stride_width);
                                        size = (app->width>>1) * (app->height>>1);
 
-                                       for (i = 0; i < app->height/2; i++) {
+                                       for (j = 0; j < app->height/2; j++) {
                                                memcpy(buf_data_ptr, tmp, app->width/2);
                                                buf_data_ptr += stride_width;
                                                tmp += app->width/2;
@@ -935,7 +935,7 @@ void _mediacodec_process_input(App *app)
                                        media_packet_get_video_stride_width(pkt, 2, &stride_width);
                                        offset += size;
 
-                                       for (i = 0; i < app->height/2; i++) {
+                                       for (j = 0; j < app->height/2; j++) {
                                                memcpy(buf_data_ptr, tmp, app->width/2);
                                                buf_data_ptr += stride_width;
                                                tmp += app->width/2;