[MM] Cleanup dead codes(pixmap support) on multimedia
authormsu.koo <msu.koo@samsung.com>
Tue, 10 Nov 2015 09:41:29 +0000 (18:41 +0900)
committerYoungsoo Choi <kenshin.choi@samsung.com>
Tue, 10 Jul 2018 07:55:23 +0000 (07:55 +0000)
Pixmap was introduced for Tizen 2.4 mobile,
but Pixmap support was deprecated from Tizen 3.0.
(because Tizen 3.0 moves to wayland backend from X.)

Bug: http://165.213.149.170/jira/browse/TSAM-558

Reviewed by: sm.venugopal, sns.park

Change-Id: I4a5a10d15105a764c8fcc63d340ecfcd657c3975
Signed-off-by: msu.koo <msu.koo@samsung.com>
17 files changed:
tizen_src/chromium_impl/content/browser/media/efl/browser_media_player_manager_efl.cc
tizen_src/chromium_impl/content/browser/media/efl/browser_media_player_manager_efl.h
tizen_src/chromium_impl/content/common/media/efl/media_player_messages_efl.h
tizen_src/chromium_impl/content/renderer/media/efl/renderer_media_player_manager_efl.cc
tizen_src/chromium_impl/content/renderer/media/efl/renderer_media_player_manager_efl.h
tizen_src/chromium_impl/content/renderer/media/efl/webmediaplayer_efl.cc
tizen_src/chromium_impl/content/renderer/media/efl/webmediaplayer_efl.h
tizen_src/chromium_impl/media/base/efl/media_player_bridge_gstreamer.cc
tizen_src/chromium_impl/media/base/efl/media_player_bridge_gstreamer.h
tizen_src/chromium_impl/media/base/efl/media_player_manager_efl.h
tizen_src/chromium_impl/media/base/efl/media_player_util_efl.h
tizen_src/chromium_impl/media/base/efl/media_source_player_gstreamer.cc
tizen_src/chromium_impl/media/base/efl/media_source_player_gstreamer.h
tizen_src/chromium_impl/media/base/tizen/media_player_bridge_capi.cc
tizen_src/chromium_impl/media/base/tizen/media_player_bridge_capi.h
tizen_src/chromium_impl/media/base/tizen/media_source_player_capi.cc
tizen_src/chromium_impl/media/base/tizen/media_source_player_capi.h

index 214f074..b808c82 100644 (file)
@@ -126,16 +126,6 @@ void BrowserMediaPlayerManagerEfl::OnNewTbmBufferAvailable(
 }
 #endif
 
-#if defined(TIZEN_MULTIMEDIA_PIXMAP_SUPPORT)
-void BrowserMediaPlayerManagerEfl::OnPlatformSurfaceUpdated(
-    int player_id,
-    int pixmap_id,
-    base::TimeDelta timestamp) {
-  Send(new MediaPlayerEflMsg_PlatformSurfaceUpdated(
-      GetRoutingID(), player_id, pixmap_id, timestamp));
-}
-#endif
-
 void BrowserMediaPlayerManagerEfl::OnTimeChanged(int player_id) {
   Send(new MediaPlayerEflMsg_TimeChanged(GetRoutingID(), player_id));
 }
index a475593..430982b 100644 (file)
@@ -57,11 +57,6 @@ class CONTENT_EXPORT BrowserMediaPlayerManagerEfl
       base::TimeDelta timestamp) override;
 #endif
 
-#if defined(TIZEN_MULTIMEDIA_PIXMAP_SUPPORT)
-  void OnPlatformSurfaceUpdated(int player_id, int pixmap_id,
-                                base::TimeDelta timestamp) override;
-#endif
-
   // Helper function to handle IPC from RenderMediaPlayerMangaerEfl.
   virtual void OnPlay(int player_id);
   virtual void OnPause(int player_id);
index dfcaebb..c750bb2 100644 (file)
@@ -157,13 +157,6 @@ IPC_MESSAGE_ROUTED3(MediaPlayerEflMsg_NewTbmBufferAvailable,
                     base::TimeDelta /* time stamp */)
 #endif
 
-#if defined(OS_TIZEN)
-IPC_MESSAGE_ROUTED3(MediaPlayerEflMsg_PlatformSurfaceUpdated,
-                    int /* player_id */,
-                    int /* pixmap_id */,
-                    base::TimeDelta /* time stamp */)
-#endif
-
 // Seek.
 IPC_MESSAGE_ROUTED2(MediaPlayerEflHostMsg_Seek,
                     int /* player_id */,
index 03d5b8f..9871a46 100644 (file)
@@ -61,10 +61,6 @@ bool RendererMediaPlayerManager::OnMessageReceived(
     IPC_MESSAGE_HANDLER(MediaPlayerEflMsg_NewTbmBufferAvailable,
                         OnNewTbmBufferAvailable)
 #endif
-#if defined(TIZEN_MULTIMEDIA_PIXMAP_SUPPORT)
-    IPC_MESSAGE_HANDLER(MediaPlayerEflMsg_PlatformSurfaceUpdated,
-                        OnPlatformSurfaceUpdated)
-#endif
   IPC_MESSAGE_UNHANDLED(handled = false)
   IPC_END_MESSAGE_MAP()
   return handled;
@@ -184,17 +180,6 @@ void RendererMediaPlayerManager::OnNewTbmBufferAvailable(
 }
 #endif
 
-#if defined(TIZEN_MULTIMEDIA_PIXMAP_SUPPORT)
-void RendererMediaPlayerManager::OnPlatformSurfaceUpdated(
-    int player_id,
-    int pixmap_id,
-    base::TimeDelta timestamp) {
-  WebMediaPlayerEfl* player = GetMediaPlayer(player_id);
-  if (player)
-    player->OnPlatformSurfaceUpdated(pixmap_id, timestamp);
-}
-#endif
-
 WebMediaPlayerEfl* RendererMediaPlayerManager::GetMediaPlayer(
     int player_id) {
   std::map<int, WebMediaPlayerEfl*>::iterator iter =
index f21edd4..8275cc9 100644 (file)
@@ -74,10 +74,6 @@ class RendererMediaPlayerManager : public RenderFrameObserver {
                                base::TimeDelta timestamp);
 #endif
 
-#if defined(TIZEN_MULTIMEDIA_PIXMAP_SUPPORT)
-  void OnPlatformSurfaceUpdated(int player_id, int pixmap_id,
-                                base::TimeDelta timestamp);
-#endif
   WebMediaPlayerEfl* GetMediaPlayer(int player_id);
   void OnMediaDataChange(int player_id, int format, int height,
                          int width, int media);
index 1e72fcb..1c004c7 100644 (file)
@@ -574,17 +574,6 @@ void WebMediaPlayerEfl::OnNewFrameAvailable(base::SharedMemoryHandle handle,
   FrameReady(video_frame);
 }
 
-#if defined(TIZEN_MULTIMEDIA_PIXMAP_SUPPORT)
-void WebMediaPlayerEfl::OnPlatformSurfaceUpdated(
-    int pixmap_id,
-    base::TimeDelta timestamp) {
-  gfx::Size size(gst_width_, gst_height_);
-  scoped_refptr<VideoFrame> video_frame = VideoFrame::WrapNativePixmap(
-      size, gfx::Rect(size), size, timestamp, pixmap_id);
-  FrameReady(video_frame);
-}
-#endif
-
 void WebMediaPlayerEfl::FrameReady(
     const scoped_refptr<VideoFrame>& frame) {
   compositor_task_runner_->PostTask(
index 3dc99d7..a909883 100644 (file)
@@ -150,10 +150,6 @@ class WebMediaPlayerEfl
                                base::TimeDelta timestamp);
 #endif
 
-#if defined(TIZEN_MULTIMEDIA_PIXMAP_SUPPORT)
-  void OnPlatformSurfaceUpdated(int pixmap_id, base::TimeDelta timestamp);
-#endif
-
   void OnMediaDataChange(int format, int height, int width, int media);
   void OnDurationChange(double duration);
   void OnTimeUpdate(double current_time);
index 1282a21..9b09f49 100644 (file)
 #include "media/base/efl/media_player_util_efl.h"
 #include "ui/gfx/geometry/size.h"
 
-#if defined(TIZEN_MULTIMEDIA_PIXMAP_SUPPORT)
-#include <gst/video/gstvideosink.h>
-#include <gst/video/videooverlay.h>
-#endif
-
 namespace {
 
 // Element name
@@ -64,25 +59,6 @@ struct GstElementDeleter {
 
 namespace media {
 
-#if defined(TIZEN_MULTIMEDIA_PIXMAP_SUPPORT)
-static Eina_Bool NotifyDamageUpdatedCB(void* data, int type, void* event) {
-  MediaPlayerBridgeGstreamer* player =
-      static_cast<MediaPlayerBridgeGstreamer*>(data);
-  if (!player)
-    return ECORE_CALLBACK_PASS_ON;
-  player->PlatformSurfaceUpdated();
-  return ECORE_CALLBACK_PASS_ON;
-}
-
-#if defined(OS_TIZEN_TV)
-static int GetPixmapIdCB(void* data) {
-  MediaPlayerBridgeGstreamer* player =
-      static_cast<MediaPlayerBridgeGstreamer*>(data);
-  return player->GetSurfaceID();
-}
-#endif
-#endif
-
 static GstBusSyncReply GstPipelineMessageCB(
     GstBus* bus,
     GstMessage* message,
@@ -193,12 +169,6 @@ MediaPlayerBridgeGstreamer::MediaPlayerBridgeGstreamer(
       is_end_reached_(false),
       is_seeking_(false),
       seek_duration_(0),
-#if defined(TIZEN_MULTIMEDIA_PIXMAP_SUPPORT)
-      pixmap_id_(0),
-      efl_pixmap_(NULL),
-      m_damage_(0),
-      m_damage_handler_(NULL),
-#endif
       error_occured_(false) {
   if (!gst_is_initialized()) {
     if (!gst_init_check(NULL, NULL, 0)) {
@@ -443,11 +413,7 @@ bool MediaPlayerBridgeGstreamer::InitPipeline() {
       NULL);
   gst_object_unref(bus);
 
-#if defined(TIZEN_MULTIMEDIA_PIXMAP_SUPPORT)
-  PrepareForVideoSink();
-#else
   PrepareForVideoFrame();
-#endif
 
   g_object_set(G_OBJECT(uridecodebinsrc_),
                kPropertyDownload, true, kPropertyBufferSize,
@@ -506,19 +472,6 @@ void MediaPlayerBridgeGstreamer::Release() {
     audio_sinkpad_ = NULL;
     video_sinkpad_ = NULL;
   }
-#if defined(TIZEN_MULTIMEDIA_PIXMAP_SUPPORT)
-  if (m_damage_) {
-    ecore_x_damage_free(m_damage_);
-    m_damage_ = 0;
-  }
-  if (m_damage_handler_) {
-    ecore_event_handler_del(m_damage_handler_);
-    m_damage_handler_ = NULL;
-  }
-  if (efl_pixmap_.get()) {
-    efl_pixmap_ = NULL;
-  }
-#endif
 }
 
 void MediaPlayerBridgeGstreamer::SetVolume(double volume) {
@@ -774,16 +727,6 @@ void MediaPlayerBridgeGstreamer::HandleMessage(GstMessage* message) {
       gst_element_set_state(pipeline_, GST_STATE_PLAYING);
       break;
     }
-    case GST_MESSAGE_ELEMENT:
-#if defined(TIZEN_MULTIMEDIA_PIXMAP_SUPPORT)
-      if (!IsXWindowHandleSet()) {
-        if (message->structure &&
-            gst_is_video_overlay_prepare_window_handle_message(message)) {
-          XWindowIdPrepared(message);
-        }
-      }
-      break;
-#endif
     default: {
       LOG(ERROR) << "Unhandled GStreamer message type : "
                  << GST_MESSAGE_TYPE_NAME(message);
@@ -904,16 +847,9 @@ void MediaPlayerBridgeGstreamer::GetFrameDetails() {
 }
 
 void MediaPlayerBridgeGstreamer::PrerollComplete() {
-#if !defined(TIZEN_MULTIMEDIA_PIXMAP_SUPPORT)
-  if (media_type_ & MEDIA_VIDEO_MASK) {
-    GetFrameDetails();
-  } else
-#endif
-  {
-    manager()->OnMediaDataChange(
-        GetPlayerId(), static_cast<int>(video_format_),
-        height_, width_, media_type_);
-  }
+  manager()->OnMediaDataChange(
+      GetPlayerId(), static_cast<int>(video_format_),
+      height_, width_, media_type_);
   is_prerolled_ = true;
 }
 
@@ -943,11 +879,7 @@ void MediaPlayerBridgeGstreamer::OnUpdateStates() {
 }
 
 GstElement* MediaPlayerBridgeGstreamer::GetVideoSink() {
-#if defined(TIZEN_MULTIMEDIA_PIXMAP_SUPPORT)
-  return gst_element_factory_make("xvimagesink", kVideoSink);
-#else
   return gst_element_factory_make("appsink", kVideoSink);
-#endif
 }
 
 void MediaPlayerBridgeGstreamer::PrepareForVideoFrame() {
@@ -957,64 +889,6 @@ void MediaPlayerBridgeGstreamer::PrepareForVideoFrame() {
                              this, NULL);
 }
 
-#if defined(TIZEN_MULTIMEDIA_PIXMAP_SUPPORT)
-void MediaPlayerBridgeGstreamer::PrepareForVideoSink() {
-  int flags = 0;
-  g_object_get(pipeline_, "flags", &flags, NULL);
-  flags |= GST_PLAY_FLAG_NATIVE_VIDEO;
-  flags &= ~GST_PLAY_FLAG_TEXT;
-  g_object_set(pipeline_, "flags", flags, NULL);
-}
-
-void MediaPlayerBridgeGstreamer::XWindowIdPrepared(GstMessage* message) {
-  // It is called just once after video src is set.
-  const GstStructure* structure = gst_message_get_structure(message);
-  gst_structure_get_int(structure, "video-width", &width_);
-  gst_structure_get_int(structure, "video-height", &height_);
-  SetPixmap();
-}
-
-int MediaPlayerBridgeGstreamer::GetSurfaceID() const {
-  return pixmap_id_;
-}
-
-void MediaPlayerBridgeGstreamer::SetPixmap() {
-  efl_pixmap_ = gfx::EflPixmap::Create(gfx::EflPixmap::SURFACE,
-                                       gfx::Size(width_, height_));
-
-  if (!efl_pixmap_.get()) {
-    LOG(ERROR) << "gfx::EflPixmap::Create() failed to create Pixmap";
-    return;
-  }
-
-  pixmap_id_ = efl_pixmap_->GetId();
-#if defined(OS_TIZEN_TV)
-  g_object_set(appsink_, "pixmap-id-callback", GetPixmapIdCB, NULL);
-  g_object_set(appsink_, "pixmap-id-callback-userdata", this, NULL);
-#else
-  gst_x_overlay_set_window_handle(GST_X_OVERLAY(appsink_), pixmap_id_);
-#endif
-
-  // Register to get notification from ecore for damage updates.
-  m_damage_ = ecore_x_damage_new(pixmap_id_,
-                                 ECORE_X_DAMAGE_REPORT_RAW_RECTANGLES);
-  m_damage_handler_ = ecore_event_handler_add(ECORE_X_EVENT_DAMAGE_NOTIFY,
-                                              NotifyDamageUpdatedCB, this);
-  g_object_set(appsink_, "rotate", DEGREE_0, NULL);
-
-  PrerollComplete();
-}
-
-void MediaPlayerBridgeGstreamer::PlatformSurfaceUpdated() {
-  gint64 current_time = 0;
-  GstFormat format = GST_FORMAT_TIME;
-  gst_element_query_position(pipeline_, format, &current_time);
-  base::TimeDelta timestamp = base::TimeDelta::FromMicroseconds(
-      current_time / base::Time::kNanosecondsPerMicrosecond);
-  manager()->OnPlatformSurfaceUpdated(GetPlayerId(), pixmap_id_, timestamp);
-}
-#endif
-
 void MediaPlayerBridgeGstreamer::OnNewPadAdded(GstPad* new_pad) {
   GstCaps* new_pad_caps = gst_pad_query_caps(new_pad, NULL);
   const gchar* new_pad_type =
index 7cd1814..2d493cb 100644 (file)
 #include "media/base/video_frame.h"
 #include "third_party/WebKit/public/platform/WebMediaPlayer.h"
 
-#if defined(TIZEN_MULTIMEDIA_PIXMAP_SUPPORT)
-#include "ui/gl/efl_pixmap.h"
-
-#include <Ecore.h>
-#include "ecore_x_wayland_wrapper.h"
-#endif
-
 namespace media {
 
 class MEDIA_EXPORT MediaPlayerBridgeGstreamer
@@ -54,11 +47,6 @@ class MEDIA_EXPORT MediaPlayerBridgeGstreamer
   void SampleReady(GstSample* buffer);
   void PrerollComplete();
 
-#if defined(TIZEN_MULTIMEDIA_PIXMAP_SUPPORT)
-  void PlatformSurfaceUpdated();
-  int GetSurfaceID() const;
-#endif
-
   void OnNewPadAdded(GstPad* pad);
   void OnNoMorePadsAvailable();
 
@@ -93,13 +81,6 @@ class MEDIA_EXPORT MediaPlayerBridgeGstreamer
   GstElement* GetVideoSink();
   void PrepareForVideoFrame();
 
-#if defined(TIZEN_MULTIMEDIA_PIXMAP_SUPPORT)
-  void PrepareForVideoSink();
-  void XWindowIdPrepared(GstMessage* message);
-  bool IsXWindowHandleSet() {return pixmap_id_ ? true : false ;}
-  void SetPixmap();
-#endif
-
  private:
   const scoped_refptr<base::SingleThreadTaskRunner> main_loop_;
   GstElement* pipeline_;
@@ -132,13 +113,6 @@ class MEDIA_EXPORT MediaPlayerBridgeGstreamer
   bool is_seeking_;
   double seek_duration_;
 
-#if defined(TIZEN_MULTIMEDIA_PIXMAP_SUPPORT)
-  int pixmap_id_;
-  scoped_refptr<gfx::EflPixmap> efl_pixmap_;
-  Ecore_X_Damage m_damage_;
-  Ecore_Event_Handler* m_damage_handler_;
-#endif
-
   bool error_occured_;
 
   base::RepeatingTimer current_time_update_timer_;
index bd4e707..8b4244e 100644 (file)
@@ -49,10 +49,6 @@ class MEDIA_EXPORT MediaPlayerManager {
       int player_id, gfx::TbmBufferHandle tbm_handle,
       base::TimeDelta timestamp) = 0;
 #endif
-#if defined(TIZEN_MULTIMEDIA_PIXMAP_SUPPORT)
-  virtual void OnPlatformSurfaceUpdated(int player_id, int pixmap_id,
-                                        base::TimeDelta timestamp) = 0;
-#endif
   virtual void OnInitComplete(int player_id, bool success) = 0;
   virtual void OnResumeComplete(int player_id) = 0;
   virtual void OnSuspendComplete(int player_id) = 0;
index 99a1908..f6c1e92 100644 (file)
@@ -40,15 +40,6 @@ typedef enum {
   GST_PLAY_FLAG_SOFT_COLORBALANCE = (1 << 10)
 } GstPlayFlags;
 
-#if defined(TIZEN_MULTIMEDIA_PIXMAP_SUPPORT)
-typedef enum {
-  DEGREE_0,  // No rotate.
-  DEGREE_90,  // Rotate 90 degree count clockwise.
-  DEGREE_180,  // Rotate 180 degree count clockwise.
-  DEGREE_270  // Rotate 270 degree count clockwise.
-} RotateAngle;
-#endif
-
 typedef enum {
   GST_AUTOPLUG_SELECT_TRY,
   GST_AUTOPLUG_SELECT_EXPOSE,
index 9488065..04e8298 100644 (file)
@@ -66,13 +66,6 @@ const VideoCodecGstElementsMapping VideoMapping[] = {
     {media::kUnknownVideoCodec, NULL}
 };
 
-#if defined(TIZEN_MULTIMEDIA_PIXMAP_SUPPORT)
-// Generating Unique integer for given height / width.
-int GetUniqueKey(int x, int y) {
-  return ((x << 16) | y);
-}
-#endif
-
 }  // namespace
 
 namespace media {
@@ -91,28 +84,6 @@ static GstBusSyncReply GstPipelineMessageCB(
   return GST_BUS_DROP;
 }
 
-#if defined(TIZEN_MULTIMEDIA_PIXMAP_SUPPORT)
-static Eina_Bool NotifyDamageUpdatedCB(
-    void* user_data,
-    int type,
-    void* event) {
-  MediaSourcePlayerGstreamer* player =
-      static_cast<MediaSourcePlayerGstreamer*>(user_data);
-  if (!player || player->IsPlayerDestructing())
-    return ECORE_CALLBACK_PASS_ON;
-  player->PlatformSurfaceUpdated();
-  return ECORE_CALLBACK_PASS_ON;
-}
-
-#if defined(OS_TIZEN_TV)
-static int GetPixmapIdCB(void* user_data) {
-  MediaSourcePlayerGstreamer* player =
-      static_cast<MediaSourcePlayerGstreamer*>(user_data);
-  return player->GetSurfaceID();
-}
-#endif
-#endif
-
 static void  OnGstStartVideoFeedCB(
     GstAppSrc* pipeline,
     guint size,
@@ -197,19 +168,6 @@ static void OnGstStopAudioFeedCB(GstAppSrc* pipeline, void* user_data) {
   player->OnStopDemuxedData(media::DemuxerStream::AUDIO);
 }
 
-#if defined(TIZEN_MULTIMEDIA_PIXMAP_SUPPORT)
-static void OnVideoSinkCapsChangedCB(
-    GObject* gobject,
-    GParamSpec* gparamspec,
-    void* user_data) {
-  MediaSourcePlayerGstreamer* player =
-      static_cast<MediaSourcePlayerGstreamer*>(user_data);
-  if (!player || player->IsPlayerDestructing())
-    return;
-  player->OnVideoConfigsChanged();
-}
-#endif
-
 MediaPlayerEfl* MediaPlayerEfl::CreatePlayer(
     int player_id, content::BrowserDemuxerEfl* demuxer,
     int demuxer_id, MediaPlayerManager* manager) {
@@ -228,12 +186,6 @@ MediaSourcePlayerGstreamer::MediaSourcePlayerGstreamer(
       task_runner_(base::ThreadTaskRunnerHandle::Get()),
       playing_(false),
       weak_this_(this),
-#if defined(TIZEN_MULTIMEDIA_PIXMAP_SUPPORT)
-      pixmap_id_(0),
-      efl_pixmap_(NULL),
-      m_damage_(0),
-      m_damage_handler_(0),
-#endif
       is_xwindow_handle_set_(false),
       pipeline_(NULL),
       video_appsrc_(NULL),
@@ -267,9 +219,6 @@ MediaSourcePlayerGstreamer::MediaSourcePlayerGstreamer(
   demuxer_->Initialize(this);
   audio_buffer_queue_.clear();
   video_buffer_queue_.clear();
-#if defined(TIZEN_MULTIMEDIA_PIXMAP_SUPPORT)
-  efl_pixmaps_map_.clear();
-#endif
 }
 
 void MediaSourcePlayerGstreamer::Initialize() {
@@ -422,26 +371,8 @@ void MediaSourcePlayerGstreamer::Release() {
     gst_object_unref(pipeline_);
     pipeline_ = NULL;
   }
-
-#if defined(TIZEN_MULTIMEDIA_PIXMAP_SUPPORT)
-  UnregisterDamageHandler();
-  efl_pixmaps_map_.clear();
-#endif
 }
 
-#if defined(TIZEN_MULTIMEDIA_PIXMAP_SUPPORT)
-void MediaSourcePlayerGstreamer::UnregisterDamageHandler() {
-  if (m_damage_) {
-    ecore_x_damage_free(m_damage_);
-    m_damage_ = 0;
-  }
-  if (m_damage_handler_) {
-    ecore_event_handler_del(m_damage_handler_);
-    m_damage_handler_ = 0;
-  }
-}
-#endif
-
 void MediaSourcePlayerGstreamer::SetVolume(double volume) {
   if (audio_volume_)
     g_object_set(G_OBJECT(audio_volume_), "volume", volume, NULL);
@@ -524,12 +455,8 @@ void MediaSourcePlayerGstreamer::OnDemuxerConfigsAvailable(
         HandleError(blink::WebMediaPlayer::NetworkStateDecodeError);
         return;
       }
-#if defined(TIZEN_MULTIMEDIA_PIXMAP_SUPPORT)
-      PrepareForVideoSink();
-      CreatePixmap();
-#else
       PrepareForVideoFrame();
-#endif
+
       if (video_sink_ && !gst_bin_add(GST_BIN(pipeline_), video_sink_)) {
         gst_object_unref(video_sink_);
         HandleError(blink::WebMediaPlayer::NetworkStateDecodeError);
@@ -696,24 +623,6 @@ void MediaSourcePlayerGstreamer::OnDemuxerConfigsAvailable(
   }
 }
 
-#if defined(TIZEN_MULTIMEDIA_PIXMAP_SUPPORT)
-void MediaSourcePlayerGstreamer::PrepareForVideoSink() {
-  video_sink_ = gst_element_factory_make("xvimagesink", "sink");
-  DCHECK(video_sink_ != NULL) << "Failed to initialize xvimagesink.";
-  if (video_sink_ != NULL) {
-    GstPad* video_sink_pad = gst_element_get_static_pad(video_sink_, "sink");
-    if (!video_sink_pad) {
-      LOG(ERROR) << "GStreamer sink could not be obtained";
-      HandleError(blink::WebMediaPlayer::NetworkStateDecodeError);
-      return;
-    }
-    g_signal_connect(video_sink_pad, "notify::caps",
-                     G_CALLBACK(OnVideoSinkCapsChangedCB), this);
-    gst_object_unref(video_sink_pad);
-  }
-}
-#endif
-
 void MediaSourcePlayerGstreamer::PrepareForVideoFrame() {
   is_xwindow_handle_set_ = true;
   video_sink_ = gst_element_factory_make("appsink", "sink");
@@ -1121,127 +1030,6 @@ void MediaSourcePlayerGstreamer::OnNewFrameAvailable(GstSample* sample) {
   gst_sample_unref(sample);
 }
 
-#if defined(TIZEN_MULTIMEDIA_PIXMAP_SUPPORT)
-void MediaSourcePlayerGstreamer::XWindowIdPrepared(GstMessage* message) {
-  const GstStructure* structure = gst_message_get_structure(message);
-
-  gst_structure_get_int(structure, "video-width", &width_);
-  gst_structure_get_int(structure, "video-height", &height_);
-  SetPixmap();
-  manager()->OnMediaDataChange(GetPlayerId(), video_format_, height_,
-                               width_, media_type_);
-}
-
-void MediaSourcePlayerGstreamer::PlatformSurfaceUpdated() {
-  gint64 current_time = 0;
-  GstFormat format = GST_FORMAT_TIME;
-  gst_element_query_position(pipeline_, format, &current_time);
-  base::TimeDelta timestamp = base::TimeDelta::FromMicroseconds(
-      current_time / base::Time::kNanosecondsPerMicrosecond);
-  manager()->OnPlatformSurfaceUpdated(GetPlayerId(), pixmap_id_, timestamp);
-}
-
-int MediaSourcePlayerGstreamer::GetSurfaceID() const {
-  return pixmap_id_;
-}
-
-void MediaSourcePlayerGstreamer::SetPixmap() {
-#if defined(OS_TIZEN_TV)
-  // Using below statements on mobile to set pixmap was causing two issue.
-  // 1. Video size was different than the required one whenever configaration
-  // changed
-  // 2. Sometime black screen was appearing, while video was playing.
-  // Hence for mobile keeping implementation which uses
-  // |gst_x_overlay_set_window_handle|to sep Pixmap.
-  g_object_set(video_sink_, "pixmap-id-callback", GetPixmapIdCB, NULL);
-  g_object_set(video_sink_, "pixmap-id-callback-userdata", this, NULL);
-#else
-  gst_x_overlay_set_window_handle(GST_X_OVERLAY(video_sink_), pixmap_id_);
-#endif
-  m_damage_ = ecore_x_damage_new(pixmap_id_,
-                                 ECORE_X_DAMAGE_REPORT_RAW_RECTANGLES);
-  m_damage_handler_ = ecore_event_handler_add(ECORE_X_EVENT_DAMAGE_NOTIFY,
-                                              NotifyDamageUpdatedCB, this);
-  g_object_set(video_sink_, "rotate", 0, NULL);
-  is_xwindow_handle_set_ = true;
-}
-
-void MediaSourcePlayerGstreamer::OnVideoConfigsChanged() {
-  if (!pipeline_ || error_occured_)
-    return;
-  task_runner_->PostTask(
-      FROM_HERE,
-      base::Bind(&MediaSourcePlayerGstreamer::VideoConfigsChanged,
-                 base::Unretained(this)));
-}
-
-void MediaSourcePlayerGstreamer::VideoConfigsChanged() {
-  if (!pipeline_ || IsPlayerDestructing() || error_occured_)
-    return;
-
-  GstPad* video_sink_pad = gst_element_get_static_pad(video_sink_, "sink");
-  GstCaps* caps = gst_pad_get_current_caps(GST_PAD(video_sink_pad));
-  if (!caps) {
-    LOG(ERROR) << "Cannot get CAPS!";
-    gst_object_unref(video_sink_pad);
-    return;
-  }
-
-  GstVideoInfo info;
-  gst_video_info_init(&info);
-  if (!gst_video_info_from_caps(&info, caps)) {
-    LOG(ERROR) << "Cannot get information from CAPS!";
-    gst_caps_unref(caps);
-    gst_object_unref(video_sink_pad);
-    return;
-  }
-
-  if ((width_ != info.width) || (height_ != info.height)) {
-    LOG(ERROR) << "Demuxer Video Configs and Gstreamer Video Configs doesn't"
-               <<" match.From Demuxer : width : " << width_
-               << " and height :" << height_
-               << " | From Gstreamer width : " << info.width
-               << " and Height : " << info.height;
-    width_ = info.width;
-    height_ = info.height;
-    UnregisterDamageHandler();
-    CreatePixmap();
-    SetPixmap();
-    manager()->OnMediaDataChange(
-        GetPlayerId(), video_format_, height_, width_, media_type_);
-  }
-  gst_caps_unref(caps);
-  gst_object_unref(video_sink_pad);
-}
-
-void MediaSourcePlayerGstreamer::CreatePixmap() {
-  bool is_create_new = efl_pixmaps_map_.empty();
-  int int_wh = GetUniqueKey(width_, height_);
-
-  if (!is_create_new) {
-    EflPixmapMap::iterator it = efl_pixmaps_map_.find(int_wh);
-    if (it != efl_pixmaps_map_.end()) {
-      is_create_new = false;
-      efl_pixmap_ = it->second;
-      pixmap_id_ = efl_pixmap_->GetId();
-    } else {
-      is_create_new = true;
-    }
-  }
-
-  if (is_create_new) {
-    efl_pixmap_ = gfx::EflPixmap::Create(gfx::EflPixmap::SURFACE,
-                                         gfx::Size(width_, height_));
-    if (!efl_pixmap_.get()) {
-      LOG(ERROR) << "gfx::EflPixmap::Create() failed to create Pixmap";
-      return;
-    }
-    pixmap_id_ = efl_pixmap_->GetId();
-    efl_pixmaps_map_[int_wh] = efl_pixmap_;
-  }
-}
-#endif
-
 void MediaSourcePlayerGstreamer::OnDemuxerDurationChanged(
     base::TimeDelta duration) {
   duration_ = duration.InSecondsF();
@@ -1361,14 +1149,6 @@ void MediaSourcePlayerGstreamer::HandleMessage(GstMessage* message) {
       }
       break;
     }
-    case GST_MESSAGE_ELEMENT:
-#if defined(TIZEN_MULTIMEDIA_PIXMAP_SUPPORT)
-      if (!IsXWindowHandleSet() &&
-          gst_is_video_overlay_prepare_window_handle_message(message)) {
-        XWindowIdPrepared(message);
-      }
-      break;
-#endif
     default:
       break;
   }
index 85079c4..c39fd0c 100644 (file)
 #include "media/base/decoder_buffer.h"
 #include "third_party/WebKit/public/platform/WebMediaPlayer.h"
 
-#if defined(TIZEN_MULTIMEDIA_PIXMAP_SUPPORT)
-#include <map>
-
-#include "ui/gl/efl_pixmap.h"
-#endif
-
 namespace {
 struct AudioCodecGstElementsMapping {
   media::AudioCodec codec;
@@ -81,12 +75,6 @@ class MEDIA_EXPORT MediaSourcePlayerGstreamer : public MediaPlayerEfl,
   GstSample* PullSample();
   void OnNewFrameAvailable(GstSample* sample);
 
-#if defined(TIZEN_MULTIMEDIA_PIXMAP_SUPPORT)
-  void PlatformSurfaceUpdated();
-  void OnVideoConfigsChanged();
-  int GetSurfaceID() const;
-#endif
-
   void OnReadDemuxedData(media::DemuxerStream::Type type);
   void OnStopDemuxedData(media::DemuxerStream::Type type);
 
@@ -103,15 +91,6 @@ class MEDIA_EXPORT MediaSourcePlayerGstreamer : public MediaPlayerEfl,
  private:
   void PrepareForVideoFrame();
 
-#if defined(TIZEN_MULTIMEDIA_PIXMAP_SUPPORT)
-  void PrepareForVideoSink();
-  void VideoConfigsChanged();
-  void CreatePixmap();
-  void SetPixmap();
-  bool IsXWindowHandleSet() { return is_xwindow_handle_set_;}
-  void XWindowIdPrepared(GstMessage* message);
-  void UnregisterDamageHandler();
-#endif
   void BufferMetaDataAvailable(const media::DemuxedBufferMetaData& meta_data);
 
   void ReadDemuxedData(media::DemuxerStream::Type type);
@@ -152,16 +131,6 @@ class MEDIA_EXPORT MediaSourcePlayerGstreamer : public MediaPlayerEfl,
   // Weak pointer passed to media decoder jobs for callbacks.
   base::WeakPtrFactory<MediaSourcePlayerGstreamer> weak_this_;
 
-  // To support Vedio Sink (pixmap).
-#if defined(TIZEN_MULTIMEDIA_PIXMAP_SUPPORT)
-  int pixmap_id_;
-  scoped_refptr<gfx::EflPixmap> efl_pixmap_;
-  Ecore_X_Damage m_damage_;
-  Ecore_Event_Handler* m_damage_handler_;
-  typedef std::map<int, scoped_refptr<gfx::EflPixmap> > EflPixmapMap;
-  EflPixmapMap  efl_pixmaps_map_;
-#endif
-
   // Will allow to listen to |prepare-xid| message only once.
   bool is_xwindow_handle_set_;
 
index 9d9c9ce..d736c47 100644 (file)
@@ -4,22 +4,18 @@
 
 #include "media/base/tizen/media_player_bridge_capi.h"
 
+#include <player_internal.h>
+
 #include "base/basictypes.h"
 #include "base/logging.h"
 #include "base/strings/string_util.h"
 #include "base/thread_task_runner_handle.h"
+#include "build/tizen_version.h"
 #include "media/base/efl/media_player_manager_efl.h"
 #include "media/base/efl/media_player_util_efl.h"
 #include "third_party/libyuv/include/libyuv/planar_functions.h"
 #include "ui/gfx/geometry/size.h"
 
-#include "build/tizen_version.h"
-#if defined(USE_LEGACY_PLAYER_CAPI)
-#include <player_product.h>
-#else
-#include <player_internal.h>
-#endif
-
 namespace {
 
 // Update duration every 100ms.
@@ -71,27 +67,6 @@ static void PlayerPreparedCb(void* data) {
   player->OnPlayerPrepared();
 }
 
-#if defined(TIZEN_MULTIMEDIA_PIXMAP_SUPPORT)
-static Eina_Bool NotifyDamageUpdatedCb(void* data, int type, void* event) {
-  media::MediaPlayerBridgeCapi* player =
-      static_cast<media::MediaPlayerBridgeCapi*>(data);
-  if (!player)
-    return ECORE_CALLBACK_PASS_ON;
-
-  player->PlatformSurfaceUpdated();
-  return ECORE_CALLBACK_PASS_ON;
-}
-
-// Called by player_set_x11_display_pixmap()
-static unsigned int PixmapBufferReadyCb(void* data) {
-  media::MediaPlayerBridgeCapi* player =
-      static_cast<media::MediaPlayerBridgeCapi*>(data);
-  if (!player || player->IsPlayerDestructing())
-    return -1;
-
-  return player->GetPixmapID();
-}
-#else
 static void MediaPacketDecodedCb(media_packet_h packet, void* data) {
   DCHECK(data);
   if (!packet) {
@@ -107,7 +82,6 @@ static void MediaPacketDecodedCb(media_packet_h packet, void* data) {
 
   player->OnMediaPacketUpdated(packet_holder.Pass());
 }
-#endif
 
 // Called by player_set_completed_cb()
 static void PlaybackCompleteCb(void* data) {
@@ -177,11 +151,6 @@ MediaPlayerBridgeCapi::MediaPlayerBridgeCapi(
     MediaPlayerManager* manager_in,
     const std::string& user_agent)
     : MediaPlayerEfl(player_id, manager_in),
-#if defined(TIZEN_MULTIMEDIA_PIXMAP_SUPPORT)
-      efl_pixmap_(0),
-      damage_(0),
-      damage_handler_(NULL),
-#endif
       task_runner_(base::ThreadTaskRunnerHandle::Get()),
       player_(NULL),
       url_(url),
@@ -243,14 +212,6 @@ void MediaPlayerBridgeCapi::Prepare(CompleteCB cb) {
           user_agent_.length()) != PLAYER_ERROR_NONE)
       LOG(ERROR) << "Unable to set streaming user agent.";
 
-#if defined(TIZEN_MULTIMEDIA_PIXMAP_SUPPORT)
-  ret = player_set_x11_display_pixmap(player_, PixmapBufferReadyCb, this);
-  if (ret != PLAYER_ERROR_NONE) {
-    HandleError(ret, "player_set_x11_display_pixmap");
-    RunCompleteCB(false, FROM_HERE);
-    return;
-  }
-#else
   ret = player_set_media_packet_video_frame_decoded_cb(
             player_, MediaPacketDecodedCb, this);
   if (ret != PLAYER_ERROR_NONE) {
@@ -258,21 +219,12 @@ void MediaPlayerBridgeCapi::Prepare(CompleteCB cb) {
     RunCompleteCB(false, FROM_HERE);
     return;
   }
-#endif
 
   player_set_completed_cb(player_, PlaybackCompleteCb, this);
   player_set_buffering_cb(player_, ChangedBufferingStatusCb, this);
   player_set_interrupted_cb(player_, InterruptCb, this);
   player_set_error_cb(player_, ErrorCb, this);
 
-#if defined(TIZEN_MULTIMEDIA_PIXMAP_SUPPORT)
-#if defined(USE_LEGACY_PLAYER_CAPI)
-  player_set_x11_display_visible (player_, true);
-#else
-  player_set_display_visible (player_, true);
-#endif
-#endif
-
   ret = player_prepare_async(player_, PlayerPreparedCb, this);
   if (ret != PLAYER_ERROR_NONE) {
     HandleError(ret, "player_prepare_async");
@@ -332,9 +284,7 @@ void MediaPlayerBridgeCapi::Release() {
   player_unset_interrupted_cb(player_);
   player_unset_error_cb(player_);
   player_unset_buffering_cb(player_);
-#if !defined(TIZEN_MULTIMEDIA_PIXMAP_SUPPORT)
   player_unset_media_packet_video_frame_decoded_cb(player_);
-#endif
 
   if (GetPlayerState() > PLAYER_STATE_READY &&
       player_stop(player_) != PLAYER_ERROR_NONE) {
@@ -359,20 +309,6 @@ void MediaPlayerBridgeCapi::Release() {
       manager()->OnSuspendComplete(GetPlayerId());
     }
   }
-
-#if defined(TIZEN_MULTIMEDIA_PIXMAP_SUPPORT)
-  if (damage_) {
-    ecore_x_damage_free(damage_);
-    damage_ = 0;
-  }
-  if (damage_handler_) {
-    ecore_event_handler_del(damage_handler_);
-    damage_handler_ = NULL;
-  }
-  if (efl_pixmap_.get()) {
-    efl_pixmap_ = NULL;
-  }
-#endif
 }
 
 void MediaPlayerBridgeCapi::Play() {
@@ -535,17 +471,6 @@ void MediaPlayerBridgeCapi::UpdateMediaType() {
   if (sample_rate > 0)
     media_type_ |= MEDIA_AUDIO_MASK;
 
-// FIXME : player_get_video_size() always returns zero if using media_packet.
-// Remove it once the platform issue is resolved.
-#if defined(TIZEN_MULTIMEDIA_PIXMAP_SUPPORT)
-  err = player_get_video_size(player_, &player_width_, &player_height_);
-  if (err != PLAYER_ERROR_NONE) {
-    HandleError(err, "player_get_video_size");
-    RunCompleteCB(false, FROM_HERE);
-    return;
-  }
-#endif
-
   // Video stream is present if both video width and height are valid.
   if (player_width_ > 0 && player_height_ > 0)
     media_type_ |= MEDIA_VIDEO_MASK;
@@ -702,9 +627,6 @@ void MediaPlayerBridgeCapi::PlayerPrepared() {
     return;
   }
   UpdateDuration();
-#if defined(TIZEN_MULTIMEDIA_PIXMAP_SUPPORT)
-  SetPixmap();
-#endif
   manager()->OnReadyStateChange(
       GetPlayerId(), blink::WebMediaPlayer::ReadyStateHaveEnoughData);
   manager()->OnNetworkStateChange(
@@ -713,37 +635,6 @@ void MediaPlayerBridgeCapi::PlayerPrepared() {
   RunCompleteCB(true, FROM_HERE);
 }
 
-#if defined(TIZEN_MULTIMEDIA_PIXMAP_SUPPORT)
-void MediaPlayerBridgeCapi::PlatformSurfaceUpdated() {
-  int postion = 0;
-#if defined(USE_LEGACY_PLAYER_CAPI)
-  player_get_position(player_, &postion);
-#else
-  player_get_play_position(player_, &postion);
-#endif
-  base::TimeDelta timestamp = base::TimeDelta::FromMilliseconds(postion);
-  manager()->OnPlatformSurfaceUpdated(GetPlayerId(), efl_pixmap_->GetId(),
-                                      timestamp);
-}
-
-void MediaPlayerBridgeCapi::SetPixmap() {
-  if ((media_type_ & MEDIA_VIDEO_MASK) && !efl_pixmap_.get()) {
-    efl_pixmap_ = gfx::EflPixmap::Create(
-        gfx::EflPixmap::SURFACE, gfx::Size(player_width_, player_height_));
-    if (!efl_pixmap_.get()) {
-      HandleError(0, "gfx::EflPixmap::Create");
-      RunCompleteCB(false, FROM_HERE);
-      return;
-    }
-
-    //Register to get notification from ecore for damage updates.
-    damage_ = ecore_x_damage_new(efl_pixmap_->GetId(),
-                                 ECORE_X_DAMAGE_REPORT_RAW_RECTANGLES);
-    damage_handler_ = ecore_event_handler_add(ECORE_X_EVENT_DAMAGE_NOTIFY,
-                                              NotifyDamageUpdatedCb, this);
-  }
-}
-#else
 void MediaPlayerBridgeCapi::MediaPacketUpdated(
     scoped_ptr<MediaPacketHolder> packet) {
   tbm_surface_h surface;
@@ -835,7 +726,6 @@ void MediaPlayerBridgeCapi::SendFrame(tbm_surface_h surface) {
                                  shared_memory_size, timestamp);
 #endif
 }
-#endif
 
 void MediaPlayerBridgeCapi::HandleBufferingStatus(int percent) {
   if (is_paused_ || is_seeking_)
@@ -947,14 +837,12 @@ void MediaPlayerBridgeCapi::ExecuteDelayedPlayerState() {
   }
 }
 
-#if !defined(TIZEN_MULTIMEDIA_PIXMAP_SUPPORT)
 void MediaPlayerBridgeCapi::OnMediaPacketUpdated(
     scoped_ptr<MediaPacketHolder> packet) {
   task_runner_->PostTask(
       FROM_HERE, base::Bind(&MediaPlayerBridgeCapi::MediaPacketUpdated,
                             weak_factory_.GetWeakPtr(), base::Passed(&packet)));
 }
-#endif
 
 void MediaPlayerBridgeCapi::OnPlaybackCompleteUpdate() {
   task_runner_->PostTask(
index 8ad7395..2d6908b 100644 (file)
 #include "media/base/efl/media_player_efl.h"
 #include "media/base/video_frame.h"
 
-#if defined(TIZEN_MULTIMEDIA_PIXMAP_SUPPORT)
-#include <Ecore.h>
-
-#include "ecore_x_wayland_wrapper.h"
-#include "ui/gl/efl_pixmap.h"
-#else
 #include <media_packet.h>
 #include <tbm_surface.h>
-#endif
 
 namespace media {
 
@@ -59,14 +52,8 @@ class MEDIA_EXPORT MediaPlayerBridgeCapi
 
   void ExecuteDelayedPlayerState();
 
-#if defined(TIZEN_MULTIMEDIA_PIXMAP_SUPPORT)
-  void SetPixmap();
-  int GetPixmapID() const {return efl_pixmap_->GetId();}
-  void PlatformSurfaceUpdated();
-#else
   void OnMediaPacketUpdated(scoped_ptr<MediaPacketHolder> packet);
   void SendFrame(tbm_surface_h surface);
-#endif
 
   void OnPlaybackCompleteUpdate();
   void OnSeekCompleteUpdate();
@@ -96,9 +83,7 @@ class MEDIA_EXPORT MediaPlayerBridgeCapi
   void UpdateSeekState(bool state);
   void UpdateDuration();
 
-#if !defined(TIZEN_MULTIMEDIA_PIXMAP_SUPPORT)
   void MediaPacketUpdated(scoped_ptr<MediaPacketHolder> packet);
-#endif
   void PlaybackCompleteUpdate();
   void SeekCompleteUpdate();
   void PlayerPrepared();
@@ -109,13 +94,7 @@ class MEDIA_EXPORT MediaPlayerBridgeCapi
   player_state_e GetPlayerState();
 
  private:
-#if defined(TIZEN_MULTIMEDIA_PIXMAP_SUPPORT)
-  scoped_refptr<gfx::EflPixmap> efl_pixmap_;
-  Ecore_X_Damage damage_;
-  Ecore_Event_Handler* damage_handler_;
-#else
   scoped_ptr<MediaPacketHolder> previous_packet_;
-#endif
 
   const scoped_refptr<base::SingleThreadTaskRunner> task_runner_;
 
index e315cea..c6d0ab2 100644 (file)
@@ -132,7 +132,6 @@ static void  OnCapiVideoBufStatusCB(player_media_stream_buffer_status_e status,
 }
 #endif  // USE_LEGACY_PLAYER_CAPI
 
-#ifndef TIZEN_VIDEO_HOLE
 static void OnMediaPktDecoded(media_packet_h packet, void* data) {
   if (!packet) {
     LOG(ERROR) << "media_packet handle is null";
@@ -146,7 +145,6 @@ static void OnMediaPktDecoded(media_packet_h packet, void* data) {
   }
   player->OnMediaPacketUpdated(packet);
 }
-#endif
 
 void OnPlaybackCompleteCB(void* user_data) {
   LOG(INFO) << "On playback complete Call back";
@@ -612,7 +610,7 @@ void MediaSourcePlayerCapi::SendFrame(tbm_surface_h surface) {
       GetPlayerId(), foreign_memory_handle, shared_memory_size, timestamp);
 #endif
 }
-#endif  // TIZEN_VIDEO_HOLE
+#endif  // defined(TIZEN_VIDEO_HOLE)
 
 void MediaSourcePlayerCapi::SetVolume(double volume) {
   if (GetPlayerState() <= PLAYER_STATE_IDLE)
@@ -912,7 +910,7 @@ void MediaSourcePlayerCapi::OnDemuxerConfigsAvailable(
     }
   }
 
-  // FIXME(Venu): Need to check where is the exact place for this code.
+  // TODO(Venu): Need to check where is the exact place for this code.
   // For make it work added this below code
   manager()->OnReadyStateChange(
       GetPlayerId(), blink::WebMediaPlayer::ReadyStateHaveEnoughData);
index 4e7c194..e9a0ad2 100644 (file)
@@ -19,9 +19,7 @@
 #include "media/base/decoder_buffer.h"
 #include "third_party/WebKit/public/platform/WebMediaPlayer.h"
 
-#ifndef TIZEN_VIDEO_HOLE
 #include <tbm_surface.h>
-#endif
 
 namespace media {
 
@@ -78,10 +76,8 @@ class MEDIA_EXPORT MediaSourcePlayerCapi
  private:
   void PrepareComplete();
   void BufferMetaDataAvailable(const media::DemuxedBufferMetaData& meta_data);
-#ifndef TIZEN_VIDEO_HOLE
   void MediaPacketUpdated(media_packet_h packet);
   void SendFrame(tbm_surface_h surface);
-#endif
   void ReadDemuxedData(media::DemuxerStream::Type type);
   void SaveDecoderBuffer(
       base::SharedMemoryHandle foreign_memory_handle,