'<(DEPTH)/tizen_src/build/system.gyp:capi-system-sensor',
],
'external_content_renderer_deps': [
+ '<(DEPTH)/tizen_src/build/system.gyp:gstreamer',
'<(DEPTH)/tizen_src/build/system.gyp:tts',
'<(DEPTH)/tizen_src/chromium_impl/content/content_efl.gyp:android_content_detection',
],
'renderer/media/efl/renderer_demuxer_efl.h',
'renderer/media/efl/renderer_media_player_manager_efl.cc',
'renderer/media/efl/renderer_media_player_manager_efl.h',
+ 'renderer/media/efl/webmediaplayer_efl.cc',
+ 'renderer/media/efl/webmediaplayer_efl.h', # ME and MSE
],
}], # tizen_multimedia_support==1
],
#include "base/bind.h"
#include "base/message_loop/message_loop.h"
#include "content/common/media/efl/media_player_messages_efl.h"
+#include "content/renderer/media/efl/webmediaplayer_efl.h"
namespace content {
void RendererMediaPlayerManager::PausePlayingPlayers() {
for (auto player_it : media_players_) {
- media::WebMediaPlayerEfl* player = player_it.second;
+ WebMediaPlayerEfl* player = player_it.second;
if (player && !player->paused() && player->hasVideo())
player->RequestPause();
}
void RendererMediaPlayerManager::OnMediaDataChange(int player_id, int format,
int height, int width,
int media) {
- media::WebMediaPlayerEfl* player = GetMediaPlayer(player_id);
+ WebMediaPlayerEfl* player = GetMediaPlayer(player_id);
if (player)
player->OnMediaDataChange(format, height, width, media);
}
void RendererMediaPlayerManager::OnDurationChange(
int player_id,
double duration) {
- media::WebMediaPlayerEfl* player = GetMediaPlayer(player_id);
+ WebMediaPlayerEfl* player = GetMediaPlayer(player_id);
if (player)
player->OnDurationChange(duration);
}
void RendererMediaPlayerManager::OnTimeUpdate(
int player_id,
double current_time) {
- media::WebMediaPlayerEfl* player = GetMediaPlayer(player_id);
+ WebMediaPlayerEfl* player = GetMediaPlayer(player_id);
if (player)
player->OnTimeUpdate(current_time);
}
void RendererMediaPlayerManager::OnBufferUpdate(
int player_id,
std::vector<media::MediaPlayerEfl::TimeRanges> buffer_range) {
- media::WebMediaPlayerEfl* player = GetMediaPlayer(player_id);
+ WebMediaPlayerEfl* player = GetMediaPlayer(player_id);
if (player)
player->OnBufferUpdate(buffer_range);
}
void RendererMediaPlayerManager::OnReadyStateChange(
int player_id,
media::MediaPlayerEfl::ReadyState state) {
- media::WebMediaPlayerEfl* player = GetMediaPlayer(player_id);
+ WebMediaPlayerEfl* player = GetMediaPlayer(player_id);
if (player)
player->SetReadyState(
static_cast<blink::WebMediaPlayer::ReadyState>(state));
void RendererMediaPlayerManager::OnNetworkStateChange(
int player_id,
media::MediaPlayerEfl::NetworkState state) {
- media::WebMediaPlayerEfl* player = GetMediaPlayer(player_id);
+ WebMediaPlayerEfl* player = GetMediaPlayer(player_id);
if (player)
player->SetNetworkState(
static_cast<blink::WebMediaPlayer::NetworkState>(state));
}
void RendererMediaPlayerManager::OnTimeChanged(int player_id) {
- media::WebMediaPlayerEfl* player = GetMediaPlayer(player_id);
+ WebMediaPlayerEfl* player = GetMediaPlayer(player_id);
if (player)
player->OnTimeChanged();
}
void RendererMediaPlayerManager::OnSeekStateChange(int player_id,
bool state) {
- media::WebMediaPlayerEfl* player = GetMediaPlayer(player_id);
+ WebMediaPlayerEfl* player = GetMediaPlayer(player_id);
if (player)
player->OnSeekStateChange(state);
}
void RendererMediaPlayerManager::OnPauseStateChange(int player_id,
bool state) {
- media::WebMediaPlayerEfl* player = GetMediaPlayer(player_id);
+ WebMediaPlayerEfl* player = GetMediaPlayer(player_id);
if (player)
player->OnPauseStateChange(state);
}
void RendererMediaPlayerManager::OnRequestSeek(int player_id,
double seek_time) {
- media::WebMediaPlayerEfl* player = GetMediaPlayer(player_id);
+ WebMediaPlayerEfl* player = GetMediaPlayer(player_id);
if (player)
player->OnRequestSeek(seek_time);
}
int player_id,
base::SharedMemoryHandle foreign_memory_handle,
uint32 length, base::TimeDelta timestamp) {
- media::WebMediaPlayerEfl* player = GetMediaPlayer(player_id);
+ WebMediaPlayerEfl* player = GetMediaPlayer(player_id);
if (player)
player->OnNewFrameAvailable(foreign_memory_handle, length, timestamp);
}
int player_id,
int pixmap_id,
base::TimeDelta timestamp) {
- media::WebMediaPlayerEfl* player = GetMediaPlayer(player_id);
+ WebMediaPlayerEfl* player = GetMediaPlayer(player_id);
if (player)
player->OnPlatformSurfaceUpdated(pixmap_id, timestamp);
}
#endif
-media::WebMediaPlayerEfl* RendererMediaPlayerManager::GetMediaPlayer(
+WebMediaPlayerEfl* RendererMediaPlayerManager::GetMediaPlayer(
int player_id) {
- std::map<int, media::WebMediaPlayerEfl*>::iterator iter =
+ std::map<int, WebMediaPlayerEfl*>::iterator iter =
media_players_.find(player_id);
if (iter != media_players_.end())
return iter->second;
}
int RendererMediaPlayerManager::RegisterMediaPlayer(
- media::WebMediaPlayerEfl* player) {
+ WebMediaPlayerEfl* player) {
media_players_[next_media_player_id_] = player;
return next_media_player_id_++;
}
#include <map>
-#include "content/public/renderer/render_frame_observer.h"
+#include "base/memory/shared_memory.h"
#include "content/common/media/efl/media_player_messages_enums_efl.h"
+#include "content/public/renderer/render_frame_observer.h"
#include "media/base/efl/media_player_efl.h"
-#include "media/base/efl/webmediaplayer_efl.h"
#include "url/gurl.h"
-namespace media {
-class WebMediaPlayerEfl;
-}
-
namespace content {
+class WebMediaPlayerEfl;
class RendererMediaPlayerManager : public RenderFrameObserver {
public:
void DestroyPlayer(int player_id);
// Registers and unregisters a WebMediaPlayerEfl object.
- int RegisterMediaPlayer(media::WebMediaPlayerEfl* player);
+ int RegisterMediaPlayer(WebMediaPlayerEfl* player);
void UnregisterMediaPlayer(int player_id);
// RenderFrameObserver overrides.
void OnPlatformSurfaceUpdated(int player_id, int pixmap_id,
base::TimeDelta timestamp);
#endif
- media::WebMediaPlayerEfl* GetMediaPlayer(int player_id);
+ WebMediaPlayerEfl* GetMediaPlayer(int player_id);
void OnMediaDataChange(int player_id, int format, int height,
int width, int media);
void OnDurationChange(int player_id, double duration);
media::MediaPlayerEfl::NetworkState state);
private:
- std::map<int, media::WebMediaPlayerEfl*> media_players_;
+ std::map<int, WebMediaPlayerEfl*> media_players_;
int next_media_player_id_;
DISALLOW_COPY_AND_ASSIGN(RendererMediaPlayerManager);
-// Copyright 2014 Samsung Electronics Inc. All rights reserved.
+// Copyright 2015 Samsung Electronics Inc. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "media/base/efl/webmediaplayer_efl.h"
-
-#include <gst/gst.h>
+#include "content/renderer/media/efl/webmediaplayer_efl.h"
#include "cc/blink/web_layer_impl.h"
#include "cc/layers/video_layer.h"
#include "content/renderer/render_frame_impl.h"
#include "content/renderer/render_thread_impl.h"
#include "media/base/bind_to_current_loop.h"
-#include "media/base/efl/media_player_efl.h"
#include "media/base/efl/media_player_util_efl.h"
#include "media/base/video_frame.h"
#include "media/blink/webmediaplayer_util.h"
(DCHECK(main_loop_->BelongsToCurrentThread()), \
media::BindToCurrentLoop(base::Bind(function, AsWeakPtr())))
+using media::VideoFrame;
+
namespace content {
-MEDIA_EXPORT blink::WebMediaPlayer* CreateWebMediaPlayerEfl(
+blink::WebMediaPlayer* CreateWebMediaPlayerEfl(
content::RendererMediaPlayerManager* manager,
blink::WebFrame* frame,
blink::WebMediaPlayerClient* client,
base::WeakPtr<media::WebMediaPlayerDelegate> delegate) {
- return new media::WebMediaPlayerEfl(manager, frame, client, delegate);
+ return new WebMediaPlayerEfl(manager, frame, client, delegate);
}
-} // namespace content
-
-namespace media {
-
WebMediaPlayerEfl::WebMediaPlayerEfl(
- content::RendererMediaPlayerManager* manager,
+ RendererMediaPlayerManager* manager,
blink::WebFrame* frame,
blink::WebMediaPlayerClient* client,
base::WeakPtr<media::WebMediaPlayerDelegate> delegate)
ready_state_(blink::WebMediaPlayer::ReadyStateHaveNothing),
main_loop_(base::MessageLoopProxy::current()),
media_task_runner_(
- content::RenderThreadImpl::current()->GetMediaThreadTaskRunner()),
+ RenderThreadImpl::current()->GetMediaThreadTaskRunner()),
manager_(manager),
client_(client),
- media_log_(new content::RenderMediaLog()),
+ media_log_(new RenderMediaLog()),
delegate_(delegate),
compositor_task_runner_(
- content::RenderThreadImpl::current()->compositor_message_loop_proxy()),
+ RenderThreadImpl::current()->compositor_message_loop_proxy()),
compositor_(new media::VideoFrameCompositor(
BIND_TO_RENDER_LOOP(&WebMediaPlayerEfl::OnNaturalSizeChanged),
BIND_TO_RENDER_LOOP(&WebMediaPlayerEfl::OnOpacityChanged))),
opaque_(false),
natural_size_(0, 0),
did_loading_progress_(false),
- gpu_factories_(content::RenderThreadImpl::current()->GetGpuFactories())
+ gpu_factories_(RenderThreadImpl::current()->GetGpuFactories())
#if defined(TIZEN_MULTIMEDIA_EME_SUPPORT)
, encrypted_media_support_(
params.CreateEncryptedMediaPlayerSupport(client))
// EFL GST-package on desktop cannot handle AAC decoding.
// Disabling MSE for desktop.
player_type_ = MEDIA_PLAYER_TYPE_MEDIA_SOURCE;
- content::RendererDemuxerEfl* demuxer =
- static_cast<content::RendererDemuxerEfl*>(
- content::RenderThreadImpl::current()->renderer_demuxer());
+ RendererDemuxerEfl* demuxer =
+ static_cast<RendererDemuxerEfl*>(
+ RenderThreadImpl::current()->renderer_demuxer());
demuxer_client_id = demuxer->GetNextDemuxerClientID();
- media_source_delegate_.reset(new content::MediaSourceDelegateEfl(
+ media_source_delegate_.reset(new MediaSourceDelegateEfl(
demuxer, demuxer_client_id, media_task_runner_, media_log_.get()));
- SetDecryptorReadyCB set_decryptor_ready_cb;
- Demuxer::EncryptedMediaInitDataCB emedia_init_data_cb;
+ media::SetDecryptorReadyCB set_decryptor_ready_cb;
+ media::Demuxer::EncryptedMediaInitDataCB emedia_init_data_cb;
#if defined(TIZEN_MULTIMEDIA_EME_SUPPORT)
set_decryptor_ready_cb =
encrypted_media_support_->CreateSetDecryptorReadyCB();
}
manager_->Initialize(player_id_, player_type_,
- GetCleanURL(url.string().utf8()), 0, demuxer_client_id);
+ media::GetCleanURL(url.string().utf8()),
+ 0, demuxer_client_id);
}
#if defined(TIZEN_MULTIMEDIA_EME_SUPPORT)
const blink::WebRect& rect,
unsigned char alpha,
SkXfermode::Mode mode) {
- scoped_refptr<media::VideoFrame> video_frame =
+ scoped_refptr<VideoFrame> video_frame =
GetCurrentFrameFromCompositor();
gfx::Rect gfx_rect(rect);
- Context3D context_3d;
+ media::Context3D context_3d;
skcanvas_video_renderer_.Paint(
video_frame.get(), canvas, gfx_rect, alpha,
SkXfermode::kSrcOver_Mode, media::VIDEO_ROTATION_0, context_3d);
compositor_->SetVideoFrameProviderClient(client);
}
-scoped_refptr<media::VideoFrame>WebMediaPlayerEfl::GetCurrentFrame() {
- scoped_refptr<media::VideoFrame> current_frame =
+scoped_refptr<VideoFrame>WebMediaPlayerEfl::GetCurrentFrame() {
+ scoped_refptr<VideoFrame> current_frame =
GetCurrentFrameFromCompositor();
return current_frame;
}
// video format converted from SN12 to YV12
uint8* gst_buf = yuv_buffer;
switch (gst_video_format_) {
- case GST_VIDEO_YU12:
- case GST_VIDEO_I420: {
+ case media::GST_VIDEO_YU12:
+ case media::GST_VIDEO_I420: {
const uint c_frm_size = yuv_size / 6;
const uint y_frm_size = c_frm_size << 2; // * 4;
// U Plane buffer.
gst_width_, gst_height_);
break;
}
- case GST_VIDEO_SN12: {
- const uint tile_w_align = ((gst_width_ - 1) / SN12_TILE_WIDTH + 2) & ~1;
- const uint tile_luma_stride = tile_w_align * SN12_TILE_WIDTH;
- uint luma_size = SN12_TILE_SIZE * tile_w_align
- * ((gst_height_-1)/SN12_TILE_HEIGHT + 1);
+ case media::GST_VIDEO_SN12: {
+ const uint tile_w_align =
+ ((gst_width_ - 1) / media::SN12_TILE_WIDTH + 2) & ~1;
+ const uint tile_luma_stride = tile_w_align * media::SN12_TILE_WIDTH;
+ uint luma_size = media::SN12_TILE_SIZE * tile_w_align
+ * ((gst_height_-1) / media::SN12_TILE_HEIGHT + 1);
uint8* y_frm = video_frame.get()->data(VideoFrame::kYPlane);
const uint y_stride = video_frame.get()->stride(VideoFrame::kYPlane);
}
break;
}
- case GST_VIDEO_NV12: {
+ case media::GST_VIDEO_NV12: {
const uint c_frm_size = yuv_size / 6;
const uint y_frm_size = c_frm_size << 2; // * 4;
#endif
void WebMediaPlayerEfl::FrameReady(
- const scoped_refptr<media::VideoFrame>& frame) {
+ const scoped_refptr<VideoFrame>& frame) {
compositor_task_runner_->PostTask(
FROM_HERE,
base::Bind(&media::VideoFrameCompositor::UpdateCurrentFrame,
static void GetCurrentFrameAndSignal(
media::VideoFrameCompositor* compositor,
- scoped_refptr<media::VideoFrame>* video_frame_out,
+ scoped_refptr<VideoFrame>* video_frame_out,
base::WaitableEvent* event) {
*video_frame_out = compositor->GetCurrentFrame();
event->Signal();
}
-scoped_refptr<media::VideoFrame>
+scoped_refptr<VideoFrame>
WebMediaPlayerEfl::GetCurrentFrameFromCompositor() {
if (compositor_task_runner_->BelongsToCurrentThread())
return compositor_->GetCurrentFrame();
// Use a posted task and waitable event instead of a lock otherwise
// WebGL/Canvas can see different content than what the compositor is seeing.
- scoped_refptr<media::VideoFrame> video_frame;
+ scoped_refptr<VideoFrame> video_frame;
base::WaitableEvent event(false, false);
compositor_task_runner_->PostTask(FROM_HERE,
base::Bind(&GetCurrentFrameAndSignal,
client_->requestSeek(seek_time);
}
-} // namespace media
+} // namespace content
-// Copyright 2014 Samsung Electronics Inc. All rights reserved.
+// Copyright 2015 Samsung Electronics Inc. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef MEDIA_BASE_EFL_WEBMEDIAPLAYER_EFL_H_
-#define MEDIA_BASE_EFL_WEBMEDIAPLAYER_EFL_H_
+#ifndef CONTENT_RENDERER_MEDIA_EFL_WEBMEDIAPLAYER_EFL_H_
+#define CONTENT_RENDERER_MEDIA_EFL_WEBMEDIAPLAYER_EFL_H_
#include <vector>
#include "cc/layers/video_frame_provider_client_impl.h"
#include "content/renderer/media/efl/media_source_delegate_efl.h"
#include "content/renderer/media/efl/renderer_media_player_manager_efl.h"
+#include "media/base/efl/media_player_efl.h"
#include "media/blink/video_frame_compositor.h"
#include "media/filters/skcanvas_video_renderer.h"
#include "third_party/WebKit/public/platform/WebMediaPlayer.h"
class WebLayerImpl;
}
-namespace content {
-class RendererMediaPlayerManager;
-}
-
namespace media {
class GpuVideoAcceleratorFactories;
class MediaLog;
class MediaPlayerEfl;
class WebMediaPlayerDelegate;
+}
+
+namespace content {
+class RendererMediaPlayerManager;
// This class implements blink::WebMediaPlayer by keeping the efl
// media player in the browser process. It listens to all the status changes
// with the WebMediaPlayerEfl object in the browser process through
// |proxy|.
WebMediaPlayerEfl(
- content::RendererMediaPlayerManager* manager,
+ RendererMediaPlayerManager* manager,
blink::WebFrame* frame,
blink::WebMediaPlayerClient* client,
base::WeakPtr<media::WebMediaPlayerDelegate> delegate);
DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerEfl);
};
-} // namespace media
+} // namespace content
-#endif // MEDIA_BASE_EFL_WEBMEDIAPLAYER_EFL_H_
\ No newline at end of file
+#endif // CONTENT_RENDERER_MEDIA_EFL_WEBMEDIAPLAYER_EFL_H_
#include <gst/video/video.h>
#include "base/basictypes.h"
+#include "media/base/media_export.h"
#include "url/gurl.h"
namespace media {
double ConvertSecondsToMilliSeconds(double time);
// Removes query string from URI.
-GURL GetCleanURL(std::string url);
+MEDIA_EXPORT GURL GetCleanURL(std::string url);
int GetSN12BufferSize(int video_width, int video_height);
bool GetGstVideoBufferMetaData(GstSample* sample,
gint* video_width,
'base/efl/media_player_util_efl.h',
'base/efl/media_source_player_gstreamer.cc',
'base/efl/media_source_player_gstreamer.h',
- 'base/efl/webmediaplayer_efl.cc',
- 'base/efl/webmediaplayer_efl.h', # ME and MSE
],
'conditions': [