Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
halo
external_chromium_org
Commits
983bedfb
Commit
983bedfb
authored
10 years ago
by
Ben Murdoch
Committed by
Android (Google) Code Review
10 years ago
Browse files
Options
Download
Plain Diff
Merge "Have dedicated IPC message for pause/resume video capture stream." into lmp-dev
parents
afd2a9f8
7a872e45
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
43 additions
and
0 deletions
+43
-0
android_webview/native/aw_contents.cc
android_webview/native/aw_contents.cc
+1
-0
content/browser/android/content_view_core_impl.cc
content/browser/android/content_view_core_impl.cc
+11
-0
content/browser/android/content_view_core_impl.h
content/browser/android/content_view_core_impl.h
+1
-0
content/common/view_messages.h
content/common/view_messages.h
+7
-0
content/public/browser/android/content_view_core.h
content/public/browser/android/content_view_core.h
+1
-0
content/renderer/render_view_impl.cc
content/renderer/render_view_impl.cc
+4
-0
content/renderer/render_view_impl.h
content/renderer/render_view_impl.h
+2
-0
content/renderer/render_view_impl_android.cc
content/renderer/render_view_impl_android.cc
+16
-0
No files found.
android_webview/native/aw_contents.cc
View file @
983bedfb
...
...
@@ -869,6 +869,7 @@ void AwContents::SetIsPaused(JNIEnv* env, jobject obj, bool paused) {
ContentViewCore
::
FromWebContents
(
web_contents_
.
get
());
if
(
cvc
)
{
cvc
->
PauseOrResumeGeolocation
(
paused
);
cvc
->
PauseOrResumeVideoCaptureStream
(
paused
);
if
(
paused
)
{
cvc
->
PauseVideo
();
}
...
...
This diff is collapsed.
Click to expand it.
content/browser/android/content_view_core_impl.cc
View file @
983bedfb
...
...
@@ -374,6 +374,17 @@ void ContentViewCoreImpl::PauseOrResumeGeolocation(bool should_pause) {
web_contents_
->
geolocation_dispatcher_host
()
->
PauseOrResume
(
should_pause
);
}
void
ContentViewCoreImpl
::
PauseOrResumeVideoCaptureStream
(
bool
should_pause
)
{
RenderViewHostImpl
*
rvhi
=
static_cast
<
RenderViewHostImpl
*>
(
web_contents_
->
GetRenderViewHost
());
if
(
!
rvhi
)
return
;
if
(
should_pause
)
rvhi
->
Send
(
new
ViewMsg_PauseVideoCaptureStream
(
rvhi
->
GetRoutingID
()));
else
rvhi
->
Send
(
new
ViewMsg_ResumeVideoCaptureStream
(
rvhi
->
GetRoutingID
()));
}
// All positions and sizes are in CSS pixels.
// Note that viewport_width/height is a best effort based.
// ContentViewCore has the actual information about the physical viewport size.
...
...
This diff is collapsed.
Click to expand it.
content/browser/android/content_view_core_impl.h
View file @
983bedfb
...
...
@@ -61,6 +61,7 @@ class ContentViewCoreImpl : public ContentViewCore,
virtual
float
GetDpiScale
()
const
OVERRIDE
;
virtual
void
PauseVideo
()
OVERRIDE
;
virtual
void
PauseOrResumeGeolocation
(
bool
should_pause
)
OVERRIDE
;
virtual
void
PauseOrResumeVideoCaptureStream
(
bool
should_pause
)
OVERRIDE
;
virtual
void
RequestTextSurroundingSelection
(
int
max_length
,
const
base
::
Callback
<
void
(
const
base
::
string16
&
content
,
...
...
This diff is collapsed.
Click to expand it.
content/common/view_messages.h
View file @
983bedfb
...
...
@@ -952,6 +952,13 @@ IPC_MESSAGE_ROUTED0(ViewMsg_ImeEventAck)
IPC_MESSAGE_ROUTED1
(
ViewMsg_ExtractSmartClipData
,
gfx
::
Rect
/* rect */
)
// Send by browser when video capture stream should be suspend.
IPC_MESSAGE_ROUTED0
(
ViewMsg_PauseVideoCaptureStream
)
// Send by browser when video capture stream should be resume.
IPC_MESSAGE_ROUTED0
(
ViewMsg_ResumeVideoCaptureStream
)
#elif defined(OS_MACOSX)
// Let the RenderView know its window has changed visibility.
IPC_MESSAGE_ROUTED1
(
ViewMsg_SetWindowVisibility
,
...
...
This diff is collapsed.
Click to expand it.
content/public/browser/android/content_view_core.h
View file @
983bedfb
...
...
@@ -61,6 +61,7 @@ class CONTENT_EXPORT ContentViewCore {
virtual
float
GetDpiScale
()
const
=
0
;
virtual
void
PauseVideo
()
=
0
;
virtual
void
PauseOrResumeGeolocation
(
bool
should_pause
)
=
0
;
virtual
void
PauseOrResumeVideoCaptureStream
(
bool
should_pause
)
=
0
;
// Observer callback for frame metadata updates.
typedef
base
::
Callback
<
void
(
...
...
This diff is collapsed.
Click to expand it.
content/renderer/render_view_impl.cc
View file @
983bedfb
...
...
@@ -1126,6 +1126,10 @@ bool RenderViewImpl::OnMessageReceived(const IPC::Message& message) {
IPC_MESSAGE_HANDLER
(
ViewMsg_UpdateTopControlsState
,
OnUpdateTopControlsState
)
IPC_MESSAGE_HANDLER
(
ViewMsg_ExtractSmartClipData
,
OnExtractSmartClipData
)
IPC_MESSAGE_HANDLER
(
ViewMsg_PauseVideoCaptureStream
,
OnPauseVideoCaptureStream
)
IPC_MESSAGE_HANDLER
(
ViewMsg_ResumeVideoCaptureStream
,
OnResumeVideoCaptureStream
)
#elif defined(OS_MACOSX)
IPC_MESSAGE_HANDLER
(
ViewMsg_PluginImeCompositionCompleted
,
OnPluginImeCompositionCompleted
)
...
...
This diff is collapsed.
Click to expand it.
content/renderer/render_view_impl.h
View file @
983bedfb
...
...
@@ -765,6 +765,8 @@ class CONTENT_EXPORT RenderViewImpl
bool
enable_showing
,
bool
animate
);
void
OnExtractSmartClipData
(
const
gfx
::
Rect
&
rect
);
void
OnPauseVideoCaptureStream
();
void
OnResumeVideoCaptureStream
();
#elif defined(OS_MACOSX)
void
OnPluginImeCompositionCompleted
(
const
base
::
string16
&
text
,
int
plugin_id
);
...
...
This diff is collapsed.
Click to expand it.
content/renderer/render_view_impl_android.cc
View file @
983bedfb
...
...
@@ -9,6 +9,8 @@
#include "cc/trees/layer_tree_host.h"
#include "content/common/view_messages.h"
#include "content/renderer/gpu/render_widget_compositor.h"
#include "content/renderer/media/video_capture_impl_manager.h"
#include "content/renderer/render_thread_impl.h"
#include "third_party/WebKit/public/web/WebView.h"
namespace
content
{
...
...
@@ -73,4 +75,18 @@ void RenderViewImpl::OnExtractSmartClipData(const gfx::Rect& rect) {
routing_id_
,
clip_text
,
clip_html
,
clip_rect
));
}
void
RenderViewImpl
::
OnPauseVideoCaptureStream
()
{
#if defined(ENABLE_WEBRTC)
RenderThreadImpl
::
current
()
->
video_capture_impl_manager
()
->
SuspendDevices
(
true
);
#endif
}
void
RenderViewImpl
::
OnResumeVideoCaptureStream
()
{
#if defined(ENABLE_WEBRTC)
RenderThreadImpl
::
current
()
->
video_capture_impl_manager
()
->
SuspendDevices
(
false
);
#endif
}
}
// namespace content
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment