Commit 6aa03b32 authored by acolwell@chromium.org's avatar acolwell@chromium.org

Adding flag for turning on the Media Source API


BUG=86536
TEST=None


Review URL: http://codereview.chromium.org/8395053

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@107632 0039d316-1c4b-4281-b951-d872f2087c98
parent 962abd4b
......@@ -4835,6 +4835,12 @@ Keep your key file in a safe place. You will need it to create new versions of y
</message>
<message name="IDS_FLAGS_ENABLE_PHOTO_EDITOR_DESCRIPTION" desc="Description for the flag to enable the photo editor.">
</message>
<message name="IDS_FLAGS_ENABLE_MEDIA_SOURCE_NAME" desc="Title for the flag to enable the Media Source API on &lt;video&gt; elements.">
Enable Media Source API on &lt;video&gt; elements.
</message>
<message name="IDS_FLAGS_ENABLE_MEDIA_SOURCE_DESCRIPTION" desc="Description for the flag to enable the Media Source API on &lt;video&gt; elements.">
Enable experimental Media Source API on the video elements. This API allows JavaScript to send media data directly to a video element.
</message>
<!-- Crashes -->
<message name="IDS_CRASHES_TITLE" desc="Title for the chrome://crashes page.">
......
......@@ -443,6 +443,13 @@ const Experiment kExperiments[] = {
SINGLE_VALUE_TYPE(switches::kEnablePhotoEditor)
},
#endif
{
"enable-media-source",
IDS_FLAGS_ENABLE_MEDIA_SOURCE_NAME,
IDS_FLAGS_ENABLE_MEDIA_SOURCE_DESCRIPTION,
kOsAll,
SINGLE_VALUE_TYPE(switches::kEnableMediaSource)
},
};
const Experiment* experiments = kExperiments;
......
......@@ -571,6 +571,7 @@ void BrowserRenderProcessHost::PropagateBrowserCommandLineToRenderer(
switches::kEnableGPUServiceLogging,
switches::kEnableGPUClientLogging,
switches::kEnableLogging,
switches::kEnableMediaSource,
switches::kEnableMediaStream,
switches::kEnableStrictSiteIsolation,
switches::kDisableFullScreen,
......
......@@ -199,6 +199,9 @@ const char kEnableGPUPlugin[] = "enable-gpu-plugin";
// builds.
const char kEnableLogging[] = "enable-logging";
// Enables Media Source API on <audio>/<video> elements.
const char kEnableMediaSource[] = "enable-media-source";
// Enable media stream in WebKit.
// http://www.whatwg.org/specs/web-apps/current-work/multipage/dnd.html#mediastream
const char kEnableMediaStream[] = "enable-media-stream";
......
......@@ -72,6 +72,7 @@ CONTENT_EXPORT extern const char kEnableDeviceMotion[];
CONTENT_EXPORT extern const char kDisableFullScreen[];
extern const char kEnableGPUPlugin[];
CONTENT_EXPORT extern const char kEnableLogging[];
extern const char kEnableMediaSource[];
extern const char kEnableMediaStream[];
extern const char kEnableMonitorProfile[];
extern const char kEnableOriginBoundCerts[];
......
......@@ -479,6 +479,9 @@ void RenderThreadImpl::EnsureWebKitInitialized() {
WebRuntimeFeatures::enableGeolocation(
!command_line.HasSwitch(switches::kDisableGeolocation));
WebKit::WebRuntimeFeatures::enableMediaSource(
command_line.HasSwitch(switches::kEnableMediaSource));
WebKit::WebRuntimeFeatures::enableMediaStream(
command_line.HasSwitch(switches::kEnableMediaStream));
......
......@@ -192,8 +192,19 @@ bool WebMediaPlayerImpl::Initialize(
data_source_factory->AddFactory(simple_data_source_factory.release());
}
filter_collection_->SetDemuxerFactory(new media::FFmpegDemuxerFactory(
data_source_factory.release(), pipeline_message_loop));
scoped_ptr<media::DemuxerFactory> demuxer_factory(
new media::FFmpegDemuxerFactory(data_source_factory.release(),
pipeline_message_loop));
std::string source_url = GetClient()->sourceURL().spec();
if (!source_url.empty()) {
demuxer_factory.reset(
new media::ChunkDemuxerFactory(source_url,
demuxer_factory.release(),
proxy_));
}
filter_collection_->SetDemuxerFactory(demuxer_factory.release());
// Add in the default filter factories.
filter_collection_->AddAudioDecoder(new media::FFmpegAudioDecoder(
......@@ -645,9 +656,6 @@ void WebMediaPlayerImpl::putCurrentFrame(
}
}
// TODO(acolwell): Uncomment once WebKit changes are checked in.
// https://bugs.webkit.org/show_bug.cgi?id=64731
/*
bool WebMediaPlayerImpl::sourceAppend(const unsigned char* data,
unsigned length) {
DCHECK_EQ(main_loop_, MessageLoop::current());
......@@ -674,7 +682,6 @@ void WebMediaPlayerImpl::sourceEndOfStream(
proxy_->DemuxerEndOfStream(pipeline_status);
}
*/
void WebMediaPlayerImpl::WillDestroyCurrentMessageLoop() {
Destroy();
......@@ -797,9 +804,7 @@ void WebMediaPlayerImpl::OnNetworkEvent(bool is_downloading_data) {
void WebMediaPlayerImpl::OnDemuxerOpened() {
DCHECK_EQ(main_loop_, MessageLoop::current());
// TODO(acolwell): Uncomment once WebKit changes are checked in.
// https://bugs.webkit.org/show_bug.cgi?id=64731
//GetClient()->sourceOpened();
GetClient()->sourceOpened();
}
void WebMediaPlayerImpl::SetNetworkState(
......
......@@ -179,10 +179,8 @@ class WebMediaPlayerImpl
virtual WebKit::WebVideoFrame* getCurrentFrame();
virtual void putCurrentFrame(WebKit::WebVideoFrame* web_video_frame);
// TODO(acolwell): Uncomment once WebKit changes are checked in.
// https://bugs.webkit.org/show_bug.cgi?id=64731
//virtual bool sourceAppend(const unsigned char* data, unsigned length);
//virtual void sourceEndOfStream(EndOfStreamStatus status);
virtual bool sourceAppend(const unsigned char* data, unsigned length);
virtual void sourceEndOfStream(EndOfStreamStatus status);
// As we are closing the tab or even the browser, |main_loop_| is destroyed
// even before this object gets destructed, so we need to know when
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment