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
=== modified file 'src/core/media/gstreamer/playbin.cpp'
--- src/core/media/gstreamer/playbin.cpp 2015-11-17 10:03:46 +0000
+++ src/core/media/gstreamer/playbin.cpp 2015-12-07 08:13:06 +0000
@@ -30,15 +30,22 @@
3030
31namespace31namespace
32{32{
33void setup_video_sink_for_buffer_streaming(GstElement* video_sink)33void setup_video_sink_for_buffer_streaming(GstElement* pipeline)
34{34{
35 // Get the service-side BufferQueue (IGraphicBufferProducer) and associate it with35 // Get the service-side BufferQueue (IGraphicBufferProducer) and associate it with
36 // the SurfaceTextureClientHybris instance36 // the SurfaceTextureClientHybris instance
37 IGBPWrapperHybris igbp = decoding_service_get_igraphicbufferproducer();37 IGBPWrapperHybris igbp = decoding_service_get_igraphicbufferproducer();
38 SurfaceTextureClientHybris stc = surface_texture_client_create_by_igbp(igbp);38 SurfaceTextureClientHybris stc = surface_texture_client_create_by_igbp(igbp);
39
39 // Because mirsink is being loaded, we are definitely doing * hardware rendering.40 // Because mirsink is being loaded, we are definitely doing * hardware rendering.
40 surface_texture_client_set_hardware_rendering (stc, TRUE);41 surface_texture_client_set_hardware_rendering(stc, TRUE);
41 g_object_set (G_OBJECT (video_sink), "surface", static_cast<gpointer>(stc), static_cast<char*>(NULL));42
43 GstContext *context = gst_context_new("gst.mir.MirContext", TRUE);
44 GstStructure *structure = gst_context_writable_structure(context);
45 gst_structure_set(structure, "gst_mir_context", G_TYPE_POINTER, stc, NULL);
46
47 /* Propagate context in pipeline (needed by amchybris and mirsink) */
48 gst_element_set_context(pipeline, context);
42}49}
43}50}
44#else // MEDIA_HUB_HAVE_HYBRIS_MEDIA_COMPAT_LAYER51#else // MEDIA_HUB_HAVE_HYBRIS_MEDIA_COMPAT_LAYER
@@ -46,7 +53,7 @@
46{53{
47void setup_video_sink_for_buffer_streaming(GstElement*)54void setup_video_sink_for_buffer_streaming(GstElement*)
48{55{
49 throw core::ubuntu::media::Player::Error::OutOfProcessBufferStreamingNotSupported{};56 throw core::ubuntu::media::Player::Errors::OutOfProcessBufferStreamingNotSupported{};
50}57}
51}58}
52#endif // MEDIA_HUB_HAVE_HYBRIS_MEDIA_COMPAT_LAYER59#endif // MEDIA_HUB_HAVE_HYBRIS_MEDIA_COMPAT_LAYER
@@ -346,7 +353,7 @@
346 "No video sink configured for the current pipeline"353 "No video sink configured for the current pipeline"
347 };354 };
348355
349 setup_video_sink_for_buffer_streaming(video_sink);356 setup_video_sink_for_buffer_streaming(pipeline);
350}357}
351358
352void gstreamer::Playbin::set_volume(double new_volume)359void gstreamer::Playbin::set_volume(double new_volume)

Subscribers

People subscribed via source and target branches

to all changes: