2 * Copyright (c) 2018 Samsung Electronics Co., Ltd. All rights reserved.
4 * Contact: Jeongmo Yang <jm80.yang@samsung.com>
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
21 #include <gtest/gtest.h>
25 #include <iniparser.h>
26 #include <gst/app/gstappsrc.h>
27 #include <gst/allocators/gsttizenmemory.h>
28 #include <tbm_surface_internal.h>
31 typedef struct _codec_list_t codec_list_t;
32 #define CNAME_SIZE 512
33 #define CODEC_INI_MAX_STRLEN 256
34 #define DEFAULT_PORT "GST_PORT"
35 #define CODEC_INI_DEFAULT_PATH SYSCONFDIR"/multimedia/mmfw_media_codec.ini"
37 #define CODEC_INI_GET_STRING(x_dict, x_item, x_ini, x_default) \
39 const char *str = iniparser_getstring(x_dict, x_ini, x_default); \
42 (strlen(str) > 0) && \
43 (strlen(str) < CODEC_INI_MAX_STRLEN)) \
44 strncpy(x_item, str, strlen(str) + 1); \
46 strncpy(x_item, x_default, strlen(x_default) + 1); \
55 struct _codec_list_t {
57 char cname[CODEC_INI_MAX_STRLEN];
58 char plugins[2][CODEC_INI_MAX_STRLEN];
61 static codec_list_t codec_list[] = {
67 void get_plugins_list_from_ini(dictionary *dict, codec_list_t *codec_list, int codec_num)
73 const char *delimiters = " ,";
75 char port_name[CNAME_SIZE];
76 char temp[CNAME_SIZE];
77 char cname[CNAME_SIZE];
79 type[0] = ":hw_decoder";
80 type[1] = ":hw_encoder";
82 CODEC_INI_GET_STRING(dict, port_name, (char *)"port_in_use:media_codec_port", (char *)DEFAULT_PORT);
84 if (strcmp(port_name, DEFAULT_PORT) == 0) {
85 for (i = 0; i < 2; i++) {
86 for (j = 0; j < codec_num; j++) {
89 snprintf(cname, CNAME_SIZE, "%s", codec_list[j].cname);
91 snprintf(cname + len, CNAME_SIZE - len, "%s", type[i]);
92 CODEC_INI_GET_STRING(dict, temp, cname, (char *)"");
93 token = strtok_r(temp, delimiters, &usr_ptr);
96 if (token && index == 0)
97 strncpy(codec_list[j].plugins[i], token, strlen(token) + 1);
98 token = strtok_r(NULL, delimiters, &usr_ptr);
107 pad_added_cb(GstElement * demux, GstPad * pad, GstBin * pipeline)
109 GstElement *sink, *parse, *codec;
112 GST_INFO_OBJECT(pad, "got pad");
114 caps = gst_pad_query_caps(pad, NULL);
115 gchar *caps_str = gst_caps_to_string(caps);
116 gst_caps_unref(caps);
118 if (strstr(caps_str, "h264")) {
119 parse = gst_element_factory_make("h264parse", NULL);
120 codec = gst_element_factory_make(codec_list[H264].plugins[0], NULL);
121 } else if (strstr(caps_str, "h263")) {
122 parse = gst_element_factory_make("h263parse", NULL);
123 codec = gst_element_factory_make(codec_list[H263].plugins[0], NULL);
124 } else if (strstr(caps_str, "video/mpeg")) {
125 parse = gst_element_factory_make("mpeg4videoparse", NULL);
126 codec = gst_element_factory_make(codec_list[MPEG4].plugins[0], NULL);
128 GST_WARNING_OBJECT(pad, "non video pad");
133 sink = gst_element_factory_make("fakesink", NULL);
134 gst_bin_add_many(GST_BIN(pipeline), parse, codec, sink, NULL);
135 gst_element_link_many(demux, parse, codec, sink, NULL);
137 gst_element_set_state(parse, GST_STATE_PAUSED);
138 gst_element_set_state(codec, GST_STATE_PAUSED);
139 gst_element_set_state(sink, GST_STATE_PAUSED);
143 static GstBusSyncReply
144 error_cb(GstBus * bus, GstMessage * msg, gpointer user_data)
146 if (GST_MESSAGE_TYPE(msg) == GST_MESSAGE_ERROR) {
147 const gchar *file = (const gchar *)user_data;
151 gst_message_parse_error(msg, &err, &dbg);
152 g_error("ERROR for %s: %s\n%s\n", file, err->message, dbg);
158 gboolean bus_callback(GstBus *bus, GstMessage *msg, gpointer data)
160 switch (GST_MESSAGE_TYPE(msg)) {
161 case GST_MESSAGE_EOS:
163 case GST_MESSAGE_ERROR:
171 void buffer_add(GstElement *element, GstBuffer *buffer, GstPad *pad, gpointer data)
178 class CodecHalTest : public testing::Test
187 virtual void TearDown()
196 * @testcase InitH263DecoderP
198 * @author SR(jm80.yang)
199 * @reviewer SR(heechul.jeon)
201 * @description Positive, Initialize H.263 Decoder Plugin
203 * @passcase when h263 decoder plugin exists pipeline can be changed to GST_STATE_PAUSED
204 * @failcase when the state is not changed to GST_STATE_PAUSED
206 * @postcondition None
208 TEST_F(CodecHalTest, InitH263DecoderP)
210 GstElement *sink, *src, *codec, *pipeline;
211 GstStateChangeReturn ret;
213 pipeline = gst_pipeline_new("pipeline");
214 src = gst_element_factory_make("fakesrc", NULL);
215 codec = gst_element_factory_make(codec_list[H263].plugins[0], NULL);
216 sink = gst_element_factory_make("fakesink", NULL);
218 gst_bin_add_many(GST_BIN(pipeline), src, codec, sink, NULL);
220 ret = gst_element_set_state(pipeline, GST_STATE_PAUSED);
221 EXPECT_NE(ret, GST_STATE_CHANGE_FAILURE);
223 gst_object_unref(pipeline);
227 * @testcase InitH264DecoderP
229 * @author SR(jm80.yang)
230 * @reviewer SR(heechul.jeon)
232 * @description Positive, Initialize H.263 Decoder Plugin
234 * @passcase when h264 decoder plugin exists pipeline can be changed to GST_STATE_PAUSED
235 * @failcase when the state is not changed to GST_STATE_PAUSED
237 * @postcondition None
239 TEST_F(CodecHalTest, InitH264DecoderP)
241 GstElement *sink, *src, *codec, *pipeline;
242 GstStateChangeReturn ret;
244 pipeline = gst_pipeline_new("pipeline");
245 src = gst_element_factory_make("fakesrc", NULL);
246 codec = gst_element_factory_make(codec_list[H264].plugins[0], NULL);
247 sink = gst_element_factory_make("fakesink", NULL);
249 gst_bin_add_many(GST_BIN(pipeline), src, codec, sink, NULL);
251 ret = gst_element_set_state(pipeline, GST_STATE_PAUSED);
252 EXPECT_NE(ret, GST_STATE_CHANGE_FAILURE);
254 gst_object_unref(pipeline);
258 * @testcase InitMpeg4DecoderP
260 * @author SR(jm80.yang)
261 * @reviewer SR(heechul.jeon)
263 * @description Positive, Initialize MPEG4 Decoder Plugin
265 * @passcase when MPEG4 decoder plugin exists pipeline can be changed to GST_STATE_PAUSED
266 * @failcase when the state is not changed to GST_STATE_PAUSED
268 * @postcondition None
270 TEST_F(CodecHalTest, InitMpeg4DecoderP)
272 GstElement *sink, *src, *codec, *pipeline;
273 GstStateChangeReturn ret;
275 pipeline = gst_pipeline_new("pipeline");
276 src = gst_element_factory_make("fakesrc", NULL);
277 codec = gst_element_factory_make(codec_list[MPEG4].plugins[0], NULL);
278 sink = gst_element_factory_make("fakesink", NULL);
280 gst_bin_add_many(GST_BIN(pipeline), src, codec, sink, NULL);
282 ret = gst_element_set_state(pipeline, GST_STATE_PAUSED);
283 EXPECT_NE(ret, GST_STATE_CHANGE_FAILURE);
285 gst_object_unref(pipeline);
289 * @testcase InitH263EncoderP
291 * @author SR(jm80.yang)
292 * @reviewer SR(heechul.jeon)
294 * @description Positive, Initialize H.263 Encoder Plugin
296 * @passcase when H.263 encoder plugin exists pipeline can be changed to GST_STATE_PAUSED
297 * @failcase when the state is not changed to GST_STATE_PAUSED
299 * @postcondition None
301 TEST_F(CodecHalTest, InitH263EncoderP)
303 GstElement *sink, *src, *codec, *pipeline;
304 GstStateChangeReturn ret;
306 pipeline = gst_pipeline_new("pipeline");
307 src = gst_element_factory_make("fakesrc", NULL);
308 codec = gst_element_factory_make(codec_list[H263].plugins[1], NULL);
309 sink = gst_element_factory_make("fakesink", NULL);
311 gst_bin_add_many(GST_BIN(pipeline), src, codec, sink, NULL);
313 ret = gst_element_set_state(pipeline, GST_STATE_PAUSED);
314 EXPECT_NE(ret, GST_STATE_CHANGE_FAILURE);
316 gst_object_unref(pipeline);
320 * @testcase InitH264EncoderP
322 * @author SR(jm80.yang)
323 * @reviewer SR(heechul.jeon)
325 * @description Positive, Initialize H.264 Encoder Plugin
327 * @passcase when H.264 encoder plugin exists pipeline can be changed to GST_STATE_PAUSED
328 * @failcase when the state is not changed to GST_STATE_PAUSED
330 * @postcondition None
332 TEST_F(CodecHalTest, InitH264EncoderP)
334 GstElement *sink, *src, *codec, *pipeline;
335 GstStateChangeReturn ret;
337 pipeline = gst_pipeline_new("pipeline");
338 src = gst_element_factory_make("fakesrc", NULL);
339 codec = gst_element_factory_make(codec_list[H264].plugins[1], NULL);
340 sink = gst_element_factory_make("fakesink", NULL);
342 gst_bin_add_many(GST_BIN(pipeline), src, codec, sink, NULL);
344 ret = gst_element_set_state(pipeline, GST_STATE_PAUSED);
345 EXPECT_NE(ret, GST_STATE_CHANGE_FAILURE);
347 gst_object_unref(pipeline);
351 * @testcase InitMPEG4EncoderP
353 * @author SR(jm80.yang)
354 * @reviewer SR(heechul.jeon)
356 * @description Positive, Initialize H.264 Encoder Plugin
358 * @passcase when MPEG4 encoder plugin exists pipeline can be changed to GST_STATE_PAUSED
359 * @failcase when the state is not changed to GST_STATE_PAUSED
361 * @postcondition None
363 TEST_F(CodecHalTest, InitMpeg4EncoderP)
365 GstElement *sink, *src, *codec, *pipeline;
366 GstStateChangeReturn ret;
368 pipeline = gst_pipeline_new("pipeline");
369 src = gst_element_factory_make("fakesrc", NULL);
370 codec = gst_element_factory_make(codec_list[MPEG4].plugins[1], NULL);
371 sink = gst_element_factory_make("fakesink", NULL);
373 gst_bin_add_many(GST_BIN(pipeline), src, codec, sink, NULL);
375 ret = gst_element_set_state(pipeline, GST_STATE_PAUSED);
376 EXPECT_NE(ret, GST_STATE_CHANGE_FAILURE);
378 gst_object_unref(pipeline);
382 * @testcase DecodeH264P
384 * @author SR(jm80.yang)
385 * @reviewer SR(heechul.jeon)
387 * @description Positive, Decode H.264 Decoder Plugin
389 * @passcase when h264 decoder decode stream, pipeline can be changed to GST_STATE_PLAYING
390 * @failcase when the state is not changed to GST_STATE_PLAYING
392 * @postcondition None
394 TEST_F(CodecHalTest, DecodeH264P)
396 GstStateChangeReturn state_ret;
397 GstElement *src, *demux, *pipeline;
402 pipeline = gst_pipeline_new("pipeline");
404 src = gst_element_factory_make("filesrc", NULL);
406 demux = gst_element_factory_make("qtdemux", NULL);
408 bus = gst_element_get_bus(pipeline);
410 /* kids, don't use a sync handler for this at home, really; we do because
411 * we just want to abort and nothing else */
412 gst_bus_set_sync_handler(bus, error_cb, (gpointer) "meerkat.mp4", NULL);
414 gst_bin_add_many(GST_BIN(pipeline), src, demux, NULL);
416 gst_element_link(src, demux);
418 path = g_build_filename(TEST_FILES_PATH, "meerkat.mp4", NULL);
419 GST_INFO("reading file '%s'", path);
420 g_object_set(src, "location", path, NULL);
422 /* can't link uridecodebin and sink yet, do that later */
423 g_signal_connect(demux, "pad-added", G_CALLBACK(pad_added_cb), pipeline);
425 state_ret = gst_element_set_state(pipeline, GST_STATE_PAUSED);
427 if (state_ret == GST_STATE_CHANGE_ASYNC) {
428 GST_INFO("waiting for pipeline to reach PAUSED state");
429 state_ret = gst_element_get_state(pipeline, NULL, NULL, -1);
432 state_ret = gst_element_set_state(pipeline, GST_STATE_PLAYING);
433 EXPECT_NE(state_ret, GST_STATE_CHANGE_FAILURE);
435 GST_INFO("PAUSED, let's decode");
436 msg = gst_bus_timed_pop_filtered(bus, 10 * GST_SECOND, GST_MESSAGE_EOS);
437 GST_INFO("Done, got EOS message");
439 gst_message_unref(msg);
440 gst_object_unref(bus);
442 gst_element_set_state(pipeline, GST_STATE_NULL);
443 EXPECT_EQ(state_ret, GST_STATE_CHANGE_SUCCESS);
445 gst_object_unref(pipeline);
450 * @testcase DecodeH263P
452 * @author SR(jm80.yang)
453 * @reviewer SR(heechul.jeon)
455 * @description Positive, Decode H.263 Decoder Plugin
457 * @passcase when h263 decoder decode stream, pipeline can be changed to GST_STATE_PLAYING
458 * @failcase when the state is not changed to GST_STATE_PLAYING
460 * @postcondition None
462 TEST_F(CodecHalTest, DecodeH263P)
464 GstStateChangeReturn state_ret;
465 GstElement *src, *demux, *pipeline;
470 pipeline = gst_pipeline_new("pipeline");
472 src = gst_element_factory_make("filesrc", NULL);
474 demux = gst_element_factory_make("qtdemux", NULL);
476 bus = gst_element_get_bus(pipeline);
478 /* kids, don't use a sync handler for this at home, really; we do because
479 * we just want to abort and nothing else */
480 gst_bus_set_sync_handler(bus, error_cb, (gpointer)"she.3gp", NULL);
482 gst_bin_add_many(GST_BIN(pipeline), src, demux, NULL);
484 gst_element_link(src, demux);
486 path = g_build_filename(TEST_FILES_PATH, "she.3gp", NULL);
487 GST_INFO("reading file '%s'", path);
488 g_object_set(src, "location", path, NULL);
490 /* can't link uridecodebin and sink yet, do that later */
491 g_signal_connect(demux, "pad-added", G_CALLBACK(pad_added_cb), pipeline);
493 state_ret = gst_element_set_state(pipeline, GST_STATE_PAUSED);
495 if (state_ret == GST_STATE_CHANGE_ASYNC) {
496 GST_INFO("waiting for pipeline to reach PAUSED state");
497 state_ret = gst_element_get_state(pipeline, NULL, NULL, -1);
500 state_ret = gst_element_set_state(pipeline, GST_STATE_PLAYING);
501 EXPECT_NE(state_ret, GST_STATE_CHANGE_FAILURE);
503 GST_INFO("PAUSED, let's decode");
504 msg = gst_bus_timed_pop_filtered(bus, 10 * GST_SECOND, GST_MESSAGE_EOS);
505 GST_INFO("Done, got EOS message");
507 gst_message_unref(msg);
508 gst_object_unref(bus);
510 state_ret = gst_element_set_state(pipeline, GST_STATE_NULL);
511 EXPECT_EQ(state_ret, GST_STATE_CHANGE_SUCCESS);
512 gst_object_unref(pipeline);
518 * @testcase DecodeMPEG4P
520 * @author SR(jm80.yang)
521 * @reviewer SR(heechul.jeon)
523 * @description Positive, Decode MPEG4 Decoder Plugin
525 * @passcase when MPEG4 decoder decode stream, pipeline can be changed to GST_STATE_PLAYING
526 * @failcase when the state is not changed to GST_STATE_PLAYING
528 * @postcondition None
530 TEST_F(CodecHalTest, DecodeMPEG4P)
532 GstStateChangeReturn state_ret;
533 GstElement *src, *demux, *pipeline;
538 pipeline = gst_pipeline_new("pipeline");
540 src = gst_element_factory_make("filesrc", NULL);
542 demux = gst_element_factory_make("qtdemux", NULL);
544 bus = gst_element_get_bus(pipeline);
546 /* kids, don't use a sync handler for this at home, really; we do because
547 * we just want to abort and nothing else */
548 gst_bus_set_sync_handler(bus, error_cb, (gpointer)"mv.MP4", NULL);
550 gst_bin_add_many(GST_BIN(pipeline), src, demux, NULL);
552 gst_element_link(src, demux);
554 path = g_build_filename(TEST_FILES_PATH, "mv.MP4", NULL);
555 GST_INFO("reading file '%s'", path);
556 g_object_set(src, "location", path, NULL);
558 /* can't link uridecodebin and sink yet, do that later */
559 g_signal_connect(demux, "pad-added", G_CALLBACK(pad_added_cb), pipeline);
561 state_ret = gst_element_set_state(pipeline, GST_STATE_PAUSED);
563 if (state_ret == GST_STATE_CHANGE_ASYNC) {
564 GST_INFO("waiting for pipeline to reach PAUSED state");
565 state_ret = gst_element_get_state(pipeline, NULL, NULL, -1);
568 state_ret = gst_element_set_state(pipeline, GST_STATE_PLAYING);
569 EXPECT_NE(state_ret, GST_STATE_CHANGE_FAILURE);
571 GST_INFO("PAUSED, let's decode");
572 msg = gst_bus_timed_pop_filtered(bus, 10 * GST_SECOND, GST_MESSAGE_EOS);
573 GST_INFO("Done, got EOS message");
575 gst_message_unref(msg);
576 gst_object_unref(bus);
578 state_ret = gst_element_set_state(pipeline, GST_STATE_NULL);
579 EXPECT_EQ(state_ret, GST_STATE_CHANGE_SUCCESS);
580 gst_object_unref(pipeline);
587 * @testcase EncodeH264P
589 * @author SR(jm80.yang)
590 * @reviewer SR(heechul.jeon)
592 * @description Positive, Encode H.264 Decoder Plugin
594 * @passcase when H.264 encoder encode buffer, outbuffer will be dequed
595 * @failcase when the state is not changed to GST_STATE_PLAYING or the error occur
597 * @postcondition None
599 TEST_F(CodecHalTest, EncodeH264P)
601 GstStateChangeReturn state_ret;
602 GstElement *sink, *src, *codec, *pipeline;
607 gulong signal_handoff;
609 GstAllocator *allocator;
612 tbm_surface_h surface;
616 pipeline = gst_pipeline_new("pipeline");
618 src = gst_element_factory_make("appsrc", NULL);
620 codec = gst_element_factory_make(codec_list[H264].plugins[1], NULL);
622 bus = gst_element_get_bus(pipeline);
623 bus_watch_id = gst_bus_add_watch(bus, bus_callback, NULL);
624 gst_bin_add_many(GST_BIN(pipeline), src, codec, sink, NULL);
625 gst_element_link_many(src, codec, sink, NULL);
627 signal_handoff = g_signal_connect(sink, "handoff", G_CALLBACK(buffer_add), NULL);
628 state_ret = gst_element_set_state(pipeline, GST_STATE_PAUSED);
630 if (state_ret == GST_STATE_CHANGE_ASYNC) {
631 GST_INFO("waiting for pipeline to reach PAUSED state");
632 state_ret = gst_element_get_state(pipeline, NULL, NULL, -1);
635 state_ret = gst_element_set_state(pipeline, GST_STATE_PLAYING);
636 EXPECT_NE(state_ret, GST_STATE_CHANGE_FAILURE);
638 allocator = gst_tizen_allocator_new();
640 for (i = 0; i < 5; i++) {
641 surface = tbm_surface_internal_create_with_flags(640, 480, TBM_FORMAT_NV12, TBM_BO_NONCACHABLE);
642 mem = gst_tizen_allocator_alloc_surface(allocator, &vinfo, surface, NULL, NULL);
643 gst_buffer_append_memory(buffer, mem);
644 ret = gst_app_src_push_buffer((GstAppSrc*)src, buffer);
647 g_signal_handler_disconnect(sink, signal_handoff);
648 gst_object_unref(bus);
650 state_ret = gst_element_set_state(pipeline, GST_STATE_NULL);
651 EXPECT_EQ(state_ret, GST_STATE_CHANGE_SUCCESS);
653 gst_object_unref(pipeline);
657 * @testcase EncodeH263P
659 * @author SR(jm80.yang)
660 * @reviewer SR(heechul.jeon)
662 * @description Positive, Encode H.263 Decoder Plugin
664 * @passcase when H.263 encoder encode buffer, outbuffer will be dequed
665 * @failcase when the state is not changed to GST_STATE_PLAYING or the error occur
667 * @postcondition None
669 TEST_F(CodecHalTest, EncodeH263P)
671 GstStateChangeReturn state_ret;
672 GstElement *sink, *src, *codec, *pipeline;
678 pipeline = gst_pipeline_new("pipeline");
680 src = gst_element_factory_make("appsrc", NULL);
682 codec = gst_element_factory_make(codec_list[H263].plugins[1], NULL);
684 bus = gst_element_get_bus(pipeline);
685 bus_watch_id = gst_bus_add_watch(bus, bus_callback, NULL);
686 gst_bin_add_many(GST_BIN(pipeline), src, codec, sink, NULL);
687 gst_element_link_many(src, codec, sink, NULL);
689 state_ret = gst_element_set_state(pipeline, GST_STATE_PAUSED);
691 if (state_ret == GST_STATE_CHANGE_ASYNC) {
692 GST_INFO("waiting for pipeline to reach PAUSED state");
693 state_ret = gst_element_get_state(pipeline, NULL, NULL, -1);
696 state_ret = gst_element_set_state(pipeline, GST_STATE_PLAYING);
697 EXPECT_NE(state_ret, GST_STATE_CHANGE_FAILURE);
699 GST_INFO("PAUSED, let's encode");
700 gst_object_unref(bus);
702 state_ret = gst_element_set_state(pipeline, GST_STATE_NULL);
703 EXPECT_EQ(state_ret, GST_STATE_CHANGE_SUCCESS);
704 gst_object_unref(pipeline);
708 * @testcase EncodeMPEG4P
710 * @author SR(jm80.yang)
711 * @reviewer SR(heechul.jeon)
713 * @description Positive, Encode MPEG4 Decoder Plugin
715 * @passcase when MPEG4 encoder encode buffer, outbuffer will be dequed
716 * @failcase when the state is not changed to GST_STATE_PLAYING or the error occur
718 * @postcondition None
720 TEST_F(CodecHalTest, EncodeMPEG4P)
722 GstStateChangeReturn state_ret;
723 GstElement *sink, *src, *codec, *pipeline;
729 pipeline = gst_pipeline_new("pipeline");
731 src = gst_element_factory_make("appsrc", NULL);
733 codec = gst_element_factory_make(codec_list[MPEG4].plugins[1], NULL);
735 bus = gst_element_get_bus(pipeline);
736 bus_watch_id = gst_bus_add_watch(bus, bus_callback, NULL);
737 gst_bin_add_many(GST_BIN(pipeline), src, codec, sink, NULL);
738 gst_element_link_many(src, codec, sink, NULL);
740 state_ret = gst_element_set_state(pipeline, GST_STATE_PAUSED);
742 if (state_ret == GST_STATE_CHANGE_ASYNC) {
743 GST_INFO("waiting for pipeline to reach PAUSED state");
744 state_ret = gst_element_get_state(pipeline, NULL, NULL, -1);
747 state_ret = gst_element_set_state(pipeline, GST_STATE_PLAYING);
748 EXPECT_NE(state_ret, GST_STATE_CHANGE_FAILURE);
750 GST_INFO("PAUSED, let's encode");
751 gst_object_unref(bus);
753 state_ret = gst_element_set_state(pipeline, GST_STATE_NULL);
754 EXPECT_EQ(state_ret, GST_STATE_CHANGE_SUCCESS);
755 gst_object_unref(pipeline);
759 int main(int argc, char **argv)
764 gst_init(&argc, &argv);
765 dict = iniparser_load(CODEC_INI_DEFAULT_PATH);
767 codec_num = sizeof(codec_list) / sizeof(codec_list[0]);
768 get_plugins_list_from_ini(dict, codec_list, codec_num);
769 iniparser_freedict(dict);
770 testing::InitGoogleTest(&argc, argv);
772 return RUN_ALL_TESTS();