21 #if defined(MEDIA_HUB_HAVE_HYBRIS_MEDIA_COMPAT_LAYER) 23 #include <hybris/media/media_codec_layer.h> 24 #include <hybris/media/surface_texture_client_hybris.h> 29 struct video::HybrisGlSink::Private
31 static void on_frame_available_callback(GLConsumerWrapperHybris,
void* context)
36 auto thiz =
static_cast<Private*
>(context);
38 thiz->frame_available();
41 Private(std::uint32_t gl_texture)
42 : gl_texture{gl_texture},
43 graphics_buffer_consumer{decoding_service_get_igraphicbufferconsumer()},
44 gl_texture_consumer{gl_consumer_create_by_id_with_igbc(gl_texture, graphics_buffer_consumer)}
46 if (not graphics_buffer_consumer)
throw std::runtime_error
48 "video::HybrisGlSink: Could not connect to remote buffer queue." 51 if (not gl_texture_consumer)
throw std::runtime_error
53 "video::HybrisGlSink: Could not associate local texture id with remote buffer streak." 56 gl_consumer_set_frame_available_cb(gl_texture_consumer, Private::on_frame_available_callback,
this);
61 gl_consumer_set_frame_available_cb(gl_texture_consumer, Private::on_frame_available_callback,
nullptr);
64 std::uint32_t gl_texture;
66 IGBCWrapperHybris graphics_buffer_consumer;
67 GLConsumerWrapperHybris gl_texture_consumer;
74 static std::map<media::Player::PlayerKey, DSSessionWrapperHybris> lut;
75 static std::mutex lut_guard;
79 std::lock_guard<std::mutex> lg{lut_guard};
80 if (lut.count(key) == 0)
81 lut[key] = decoding_service_create_session(key);
84 return [](std::uint32_t texture)
90 video::HybrisGlSink::HybrisGlSink(std::uint32_t gl_texture) : d{
new Private{gl_texture}}
100 return d->frame_available;
106 gl_consumer_get_transformation_matrix(d->gl_texture_consumer, matrix);
113 gl_consumer_update_texture(d->gl_texture_consumer);
116 #endif // MEDIA_HUB_HAVE_HYBRIS_MEDIA_COMPAT_LAYER