Merge lp:~phablet-team/media-hub/gst-context into lp:media-hub/stable

Proposed by Alfonso Sanchez-Beato
Status: Merged
Approved by: Jim Hodapp
Approved revision: 168
Merged at revision: 168
Proposed branch: lp:~phablet-team/media-hub/gst-context
Merge into: lp:media-hub/stable
Diff against target: 47 lines (+12/-5)
1 file modified
src/core/media/gstreamer/playbin.cpp (+12/-5)
To merge this branch: bzr merge lp:~phablet-team/media-hub/gst-context
Reviewer Review Type Date Requested Status
Jim Hodapp (community) code Approve
Review via email: mp+279726@code.launchpad.net

Commit message

Set gstreamer context directly instead of using gobject to communicate with the video sink

Description of the change

Set gstreamer context directly instead of using gobject to communicate with the video sink

To post a comment you must log in.
Revision history for this message
Jim Hodapp (jhodapp) wrote :

Looks good, thanks!

review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/core/media/gstreamer/playbin.cpp'
2--- src/core/media/gstreamer/playbin.cpp 2015-11-17 10:03:46 +0000
3+++ src/core/media/gstreamer/playbin.cpp 2015-12-07 08:13:06 +0000
4@@ -30,15 +30,22 @@
5
6 namespace
7 {
8-void setup_video_sink_for_buffer_streaming(GstElement* video_sink)
9+void setup_video_sink_for_buffer_streaming(GstElement* pipeline)
10 {
11 // Get the service-side BufferQueue (IGraphicBufferProducer) and associate it with
12 // the SurfaceTextureClientHybris instance
13 IGBPWrapperHybris igbp = decoding_service_get_igraphicbufferproducer();
14 SurfaceTextureClientHybris stc = surface_texture_client_create_by_igbp(igbp);
15+
16 // Because mirsink is being loaded, we are definitely doing * hardware rendering.
17- surface_texture_client_set_hardware_rendering (stc, TRUE);
18- g_object_set (G_OBJECT (video_sink), "surface", static_cast<gpointer>(stc), static_cast<char*>(NULL));
19+ surface_texture_client_set_hardware_rendering(stc, TRUE);
20+
21+ GstContext *context = gst_context_new("gst.mir.MirContext", TRUE);
22+ GstStructure *structure = gst_context_writable_structure(context);
23+ gst_structure_set(structure, "gst_mir_context", G_TYPE_POINTER, stc, NULL);
24+
25+ /* Propagate context in pipeline (needed by amchybris and mirsink) */
26+ gst_element_set_context(pipeline, context);
27 }
28 }
29 #else // MEDIA_HUB_HAVE_HYBRIS_MEDIA_COMPAT_LAYER
30@@ -46,7 +53,7 @@
31 {
32 void setup_video_sink_for_buffer_streaming(GstElement*)
33 {
34- throw core::ubuntu::media::Player::Error::OutOfProcessBufferStreamingNotSupported{};
35+ throw core::ubuntu::media::Player::Errors::OutOfProcessBufferStreamingNotSupported{};
36 }
37 }
38 #endif // MEDIA_HUB_HAVE_HYBRIS_MEDIA_COMPAT_LAYER
39@@ -346,7 +353,7 @@
40 "No video sink configured for the current pipeline"
41 };
42
43- setup_video_sink_for_buffer_streaming(video_sink);
44+ setup_video_sink_for_buffer_streaming(pipeline);
45 }
46
47 void gstreamer::Playbin::set_volume(double new_volume)

Subscribers

People subscribed via source and target branches

to all changes: