Release the state limit of media_streamer_node_add() 38/236538/4
authorSangchul Lee <sc11.lee@samsung.com>
Thu, 18 Jun 2020 02:30:38 +0000 (11:30 +0900)
committerSangchul Lee <sc11.lee@samsung.com>
Fri, 19 Jun 2020 00:39:07 +0000 (09:39 +0900)
Previously, media_streamer_node_add() returns the invalid
state error when the media streamer state is not IDLE.

This condition is now released to let the user can create
a new node and link the node even if the media streamer
state is PLAYING. For example, it is possible to do these
things inside of decoded ready callback directly.

[Version] 0.1.70
[Issue Type] Improvement

Change-Id: I7188abbbf0fd303304b011425790a954033c193f
Signed-off-by: Sangchul Lee <sc11.lee@samsung.com>
packaging/capi-media-streamer.spec
src/media_streamer.c
src/media_streamer_gst.c

index e32a0e9..1b93268 100644 (file)
@@ -1,6 +1,6 @@
 Name:       capi-media-streamer
 Summary:    A Media Streamer API
-Version:    0.1.69
+Version:    0.1.70
 Release:    0
 Group:      Multimedia/API
 License:    Apache-2.0
index 60e3c66..5094df9 100644 (file)
@@ -178,7 +178,6 @@ int media_streamer_node_add(media_streamer_h streamer, media_streamer_node_h nod
 
        ms_retvm_if(ms_streamer == NULL, MEDIA_STREAMER_ERROR_INVALID_PARAMETER, "streamer is NULL");
        ms_retvm_if(ms_streamer->nodes_table == NULL, MEDIA_STREAMER_ERROR_INVALID_PARAMETER, "streamer->nodes_table is NULL");
-       ms_retvm_if(ms_streamer->state > MEDIA_STREAMER_STATE_IDLE, MEDIA_STREAMER_ERROR_INVALID_STATE, "Error: Media streamer must be in IDLE state");
        ms_retvm_if(ms_node == NULL, MEDIA_STREAMER_ERROR_INVALID_PARAMETER, "node is NULL");
        ms_retvm_if(ms_node->parent_streamer != NULL, MEDIA_STREAMER_ERROR_INVALID_OPERATION, "Node [%s] already added into Media Streamer object", ms_node->name);
 
index 026a127..60ee23f 100644 (file)
@@ -284,6 +284,7 @@ gboolean ms_bin_add_element(GstElement *bin, GstElement *element, gboolean do_re
                if (ret && do_ref) {
                        ms_debug("Element [%s] added into [%s] bin", GST_ELEMENT_NAME(element), GST_ELEMENT_NAME(bin));
                        gst_object_ref(element);
+                       gst_element_sync_state_with_parent(element);
                }
        } else {
                ms_error("Element [%s] is already added into the [%s] bin", GST_ELEMENT_NAME(element), GST_ELEMENT_NAME(parent));