Replace deprecated API 19/292019/1 accepted/tizen/unified/20230427.155830
authorJeongmo Yang <jm80.yang@samsung.com>
Wed, 26 Apr 2023 07:55:11 +0000 (16:55 +0900)
committerJeongmo Yang <jm80.yang@samsung.com>
Wed, 26 Apr 2023 07:57:12 +0000 (16:57 +0900)
- media_packet_create() -> media_packet_new()
- media_packet_create_alloc() -> media_packet_new_alloc()
- media_packet_destroy() -> media_packet_unref()

[Version] 0.1.28
[Issue Type] Code cleanup

Change-Id: I14eecd84a854b42c96afdd76212b16de1125a11f
Signed-off-by: Jeongmo Yang <jm80.yang@samsung.com>
packaging/capi-mediamuxer.spec
test/mediamuxer_test_gst.c
test/mediamuxer_test_with_demuxer.c
test/mediamuxer_test_with_mediacodec.c

index 5a42183..fd3e785 100644 (file)
@@ -1,6 +1,6 @@
 Name:       capi-mediamuxer
 Summary:    A Media Muxer library in Tizen Native API
-Version:    0.1.27
+Version:    0.1.28
 Release:    0
 Group:      Multimedia/API
 License:    Apache-2.0
index b361ce2..135c58c 100644 (file)
@@ -123,7 +123,7 @@ static void __audio_app_sink_callback(GstElement *sink, CustomData *data)
                key = 0;
        }
 
-       if (media_packet_create(media_format_a, NULL, NULL, &aud_pkt)) {
+       if (media_packet_new(media_format_a, NULL, NULL, &aud_pkt)) {
                g_print("create audio media_packet failed\n");
                goto ERROR1;
        }
@@ -217,7 +217,7 @@ static void __audio_app_sink_callback(GstElement *sink, CustomData *data)
                mediamuxer_write_sample(myMuxer, track_index_aud2, aud_pkt);
 
 ERROR2:
-       media_packet_destroy(aud_pkt);
+       media_packet_unref(aud_pkt);
 ERROR1:
        gst_buffer_unmap(buffer, &map);
        return;
@@ -319,7 +319,7 @@ static void __video_app_sink_callback(GstElement *sink, CustomData *data)
                goto ERROR2;
        }
 
-       if (media_packet_create(vidfmt, NULL, NULL, &vid_pkt)) {
+       if (media_packet_new(vidfmt, NULL, NULL, &vid_pkt)) {
                g_print("create video media_packet failed\n");
                goto ERROR2;
        }
@@ -415,7 +415,7 @@ static void __video_app_sink_callback(GstElement *sink, CustomData *data)
        mediamuxer_write_sample(myMuxer, track_index_vid, vid_pkt);
 
 ERROR3:
-       media_packet_destroy(vid_pkt);
+       media_packet_unref(vid_pkt);
 ERROR2:
        gst_caps_unref(vid_caps_gst);
 ERROR1:
@@ -517,7 +517,7 @@ void __text_app_sink_callback(GstElement *sink, CustomData *data)
                key = 0;
        }
 
-       if (media_packet_create(textfmt, NULL, NULL, &text_pkt)) {
+       if (media_packet_new(textfmt, NULL, NULL, &text_pkt)) {
                g_print("create text media_packet failed\n");
                goto ERROR1;
        }
@@ -572,7 +572,7 @@ void __text_app_sink_callback(GstElement *sink, CustomData *data)
        mediamuxer_write_sample(myMuxer, track_index_text, text_pkt);
 
 ERROR2:
-       media_packet_destroy(text_pkt);
+       media_packet_unref(text_pkt);
 ERROR1:
        media_format_unref(textfmt);
        gst_buffer_unmap(buffer, &map);
index 86efbf8..f2827fd 100644 (file)
@@ -196,7 +196,7 @@ void *_fetch_video_data(void *ptr)
                media_packet_get_buffer_data_ptr(vidbuf, &data);
                g_print("Video Read Count::[%4d] frame - get_buffer_size = %"PRIu64"\n", count, buf_size);
 
-               media_packet_destroy(vidbuf);
+               media_packet_unref(vidbuf);
 
                if (vid_eos_track)
                        break;
@@ -240,7 +240,7 @@ void *_fetch_audio_data(void *ptr)
                media_packet_get_buffer_data_ptr(audbuf, &data);
                g_print("Audio Read Count::[%4d] frame - get_buffer_size = %"PRIu64"\n", count, buf_size);
 
-               media_packet_destroy(audbuf);
+               media_packet_unref(audbuf);
 
                if (aud_eos_track)
                        break;
index 53ebc99..a7be998 100644 (file)
@@ -112,12 +112,12 @@ void _allocate_buf(void)
        /* input_buf = (media_packet_h *)malloc(sizeof(media_packet_h)*MAX_INPUT_BUF_NUM); */
 
        for (i = 0; i < MAX_INPUT_BUF_NUM; i++) {
-               media_packet_create_alloc(input_fmt, NULL, NULL, &input_buf[i]);
+               media_packet_new_alloc(input_fmt, NULL, NULL, &input_buf[i]);
                g_print("if-input queue buf = %p\n", input_buf[i]);
                g_queue_push_tail(&input_available, input_buf[i]);
        }
 #else
-       media_packet_create_alloc(input_fmt, NULL, NULL, &in_buf);
+       media_packet_new_alloc(input_fmt, NULL, NULL, &in_buf);
        g_print("else-input queue buf = %p\n", in_buf);
 #endif
        return;
@@ -237,7 +237,7 @@ static void _mediacodec_fill_buffer_cb(media_packet_h out_pkt, void *user_data)
 
        if (media_packet_get_buffer_size(pkt, &size)) {
                g_print("unable to get the buffer size actual =%"PRIu64"\n", size);
-               media_packet_destroy(pkt);
+               media_packet_unref(pkt);
                return;
        }
        /* for print log */
@@ -277,7 +277,7 @@ static void _mediacodec_fill_buffer_cb(media_packet_h out_pkt, void *user_data)
 #endif
        }
 
-       media_packet_destroy(pkt);
+       media_packet_unref(pkt);
        return;
 }
 
@@ -315,7 +315,7 @@ static void _mediacodec_empty_buffer_cb(media_packet_h pkt, void *user_data)
                g_print("availablebuf = %p\n", pkt);
 #else
                g_print("Used input buffer = %p\n", pkt);
-               media_packet_destroy(pkt);
+               media_packet_unref(pkt);
 #endif
        }
        return;