mm_attrs_set_int_by_name(attrs, "content_video_track_num", 1);
player->videosink_linked = 1;
- /* NOTE : intermediate code before doing H/W subtitle compositon */
- if (player->use_textoverlay && player->play_subtitle) {
- LOGD("using textoverlay for external subtitle");
- /* check text bin has created well */
- if (player->pipeline && player->pipeline->textbin) {
- /* get sinkpad from textoverlay */
- sinkpad = gst_element_get_static_pad(
- GST_ELEMENT(player->pipeline->textbin[MMPLAYER_T_BIN].gst),
- "video_sink");
- if (!sinkpad) {
- LOGE("failed to get sink pad from textoverlay");
- goto ERROR;
- }
-
- /* link new pad with textoverlay first */
- if (GST_PAD_LINK_OK != GST_PAD_LINK(pad, sinkpad)) {
- LOGE("failed to get pad from sinkbin\n");
- goto ERROR;
- }
-
- gst_object_unref(sinkpad);
- sinkpad = NULL;
-
- /* alright, override pad to textbin.src for futher link */
- pad = gst_element_get_static_pad(
- GST_ELEMENT(player->pipeline->textbin[MMPLAYER_T_BIN].gst),
- "src");
- if (!pad) {
- LOGE("failed to get sink pad from textoverlay");
- goto ERROR;
- }
- } else {
- LOGE("should not reach here.");
- goto ERROR;
- }
- }
-
sinkpad = gst_element_get_static_pad(GST_ELEMENT(sinkbin), "sink");
if (!sinkpad) {
LOGE("failed to get pad from sinkbin\n");
{
MMPlayerGstElement *textbin = NULL;
GList *element_bucket = NULL;
+ int surface_type = 0;
gint i = 0;
MMPLAYER_FENTER();
player->pipeline->textbin = textbin;
/* fakesink */
- if (player->use_textoverlay) {
- LOGD("use textoverlay for displaying \n");
-
- MMPLAYER_CREATE_ELEMENT_ADD_BIN(textbin, MMPLAYER_T_QUEUE, "queue", "text_t_queue", textbin[MMPLAYER_T_BIN].gst, player);
-
- MMPLAYER_CREATE_ELEMENT_ADD_BIN(textbin, MMPLAYER_T_VIDEO_QUEUE, "queue", "text_v_queue", textbin[MMPLAYER_T_BIN].gst, player);
-
- MMPLAYER_CREATE_ELEMENT_ADD_BIN(textbin, MMPLAYER_T_VIDEO_CONVERTER, "fimcconvert", "text_v_converter", textbin[MMPLAYER_T_BIN].gst, player);
-
- MMPLAYER_CREATE_ELEMENT_ADD_BIN(textbin, MMPLAYER_T_OVERLAY, "textoverlay", "text_overlay", textbin[MMPLAYER_T_BIN].gst, player);
-
- if (!gst_element_link_pads(textbin[MMPLAYER_T_VIDEO_QUEUE].gst, "src", textbin[MMPLAYER_T_VIDEO_CONVERTER].gst, "sink")) {
- LOGE("failed to link queue and converter\n");
- goto ERROR;
- }
-
- if (!gst_element_link_pads(textbin[MMPLAYER_T_VIDEO_CONVERTER].gst, "src", textbin[MMPLAYER_T_OVERLAY].gst, "video_sink")) {
- LOGE("failed to link queue and textoverlay\n");
- goto ERROR;
- }
-
- if (!gst_element_link_pads(textbin[MMPLAYER_T_QUEUE].gst, "src", textbin[MMPLAYER_T_OVERLAY].gst, "text_sink")) {
- LOGE("failed to link queue and textoverlay\n");
+ mm_attrs_get_int_by_name(player->attrs, "display_surface_type", &surface_type);
+ LOGD("surface type for subtitle : %d", surface_type);
+ switch (surface_type) {
+ case MM_DISPLAY_SURFACE_OVERLAY:
+ case MM_DISPLAY_SURFACE_NULL:
+ case MM_DISPLAY_SURFACE_REMOTE:
+ if (__mmplayer_gst_create_plain_text_elements(player) != MM_ERROR_NONE) {
+ LOGE("failed to make plain text elements\n");
goto ERROR;
}
- } else {
- int surface_type = 0;
-
- LOGD("use subtitle message for displaying \n");
-
- mm_attrs_get_int_by_name(player->attrs, "display_surface_type", &surface_type);
-
- switch (surface_type) {
- case MM_DISPLAY_SURFACE_OVERLAY:
- case MM_DISPLAY_SURFACE_NULL:
- case MM_DISPLAY_SURFACE_REMOTE:
- if (__mmplayer_gst_create_plain_text_elements(player) != MM_ERROR_NONE) {
- LOGE("failed to make plain text elements\n");
- goto ERROR;
- }
- break;
-
- default:
- break;
- }
+ break;
+ default:
+ goto ERROR;
+ break;
}
MMPLAYER_FLEAVE();
MMPLAYER_FREEIF(player->pipeline->textbin);
player->pipeline->textbin = NULL;
+ MMPLAYER_FLEAVE();
return MM_ERROR_PLAYER_INTERNAL;
}
player->playback_rate = DEFAULT_PLAYBACK_RATE;
player->play_subtitle = FALSE;
- player->use_textoverlay = FALSE;
player->play_count = 0;
player->use_decodebin = TRUE;
player->ignore_asyncdone = FALSE;
player->max_audio_channels = 0;
player->is_subtitle_force_drop = FALSE;
player->play_subtitle = FALSE;
- player->use_textoverlay = FALSE;
player->adjust_subtitle_pos = 0;
player->updated_bitrate_count = 0;
player->sound_focus.acquired = FALSE;
player->is_subtitle_force_drop = FALSE;
player->play_subtitle = FALSE;
- player->use_textoverlay = FALSE;
player->adjust_subtitle_pos = 0;
player->last_multiwin_status = FALSE;
player->has_closed_caption = FALSE;
}
}
- if (player->play_subtitle && !player->use_textoverlay)
+ if (player->play_subtitle)
event2 = gst_event_copy((const GstEvent *)event);
sinks = player->sink_elements;
/* Note : Textbin is not linked to the video or audio bin.
* It needs to send the event to the text sink seperatelly.
*/
- if (player->play_subtitle && !player->use_textoverlay) {
+ if (player->play_subtitle) {
GstElement *text_sink = GST_ELEMENT_CAST(player->pipeline->textbin[MMPLAYER_T_FAKE_SINK].gst);
if (GST_IS_ELEMENT(text_sink)) {