static int
__mmplayer_gst_create_video_filters(mm_player_t* player, GList** bucket)
{
- MMDisplaySurfaceType surface_type = MM_DISPLAY_SURFACE_NULL;
- gchar* video_csc = "videoconvert"; // default colorspace converter
+ gchar* video_csc = "videoconvert"; /* default colorspace converter */
GList* element_bucket = *bucket;
MMPLAYER_RETURN_VAL_IF_FAIL(player && player->pipeline && player->pipeline->videobin, MM_ERROR_PLAYER_NOT_INITIALIZED);
MMPLAYER_FENTER();
- mm_attrs_get_int_by_name(player->attrs, "display_surface_type", (int *)&surface_type);
-
- if (player->set_mode.video_zc) {
- video_csc = ""; /* videosinks don't use videoconvert normally */
- } else {
- /* sw codec, if player use libav, tizenwlsink need videoconvert to render shm wl-buffer which support RGB only */
- if ((surface_type == MM_DISPLAY_SURFACE_OVERLAY) && (!strncmp(player->ini.videosink_element_overlay, "tizenwlsink", strlen(player->ini.videosink_element_overlay))))
- video_csc = "videoconvert";
- }
- if (video_csc && (strcmp(video_csc, ""))) {
- MMPLAYER_CREATE_ELEMENT(player->pipeline->videobin, MMPLAYER_V_CONV, video_csc, "video converter", TRUE, player);
- LOGD("using video converter: %s", video_csc);
+ if (player->set_mode.video_zc || player->is_content_spherical) {
+ LOGD("do not need to add video filters.");
+ return MM_ERROR_NONE;
}
+ /* in case of sw codec except 360 playback,
+ * if libav video decoder is selected, videoconvert is required to render the shm wl-buffer which support RGB only via tizenwlsink. */
+ MMPLAYER_CREATE_ELEMENT(player->pipeline->videobin, MMPLAYER_V_CONV, video_csc, "video converter", TRUE, player);
+ LOGD("using video converter: %s", video_csc);
+
/* set video rotator */
- if (!player->set_mode.video_zc)
- MMPLAYER_CREATE_ELEMENT(player->pipeline->videobin, MMPLAYER_V_FLIP, "videoflip", "video rotator", TRUE, player);
+ MMPLAYER_CREATE_ELEMENT(player->pipeline->videobin, MMPLAYER_V_FLIP, "videoflip", "video rotator", TRUE, player);
*bucket = element_bucket;
MMPLAYER_FLEAVE();
return MM_ERROR_NONE;
-ERROR:
+ERROR: /* refer MMPLAYER_CREATE_ELEMENT */
*bucket = NULL;
MMPLAYER_FLEAVE();
return MM_ERROR_PLAYER_INTERNAL;
switch (surface_type) {
case MM_DISPLAY_SURFACE_OVERLAY:
{
- bool use_tbm = player->set_mode.video_zc;
+ bool use_tbm = (player->set_mode.video_zc || player->is_content_spherical);
if (!use_tbm) {
LOGD("selected videosink name: %s", videosink_element);