summaryrefslogtreecommitdiffstats
path: root/media/base
diff options
context:
space:
mode:
authorwjia@chromium.org <wjia@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-02-28 22:01:04 +0000
committerwjia@chromium.org <wjia@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-02-28 22:01:04 +0000
commit1fa37522cade3c1bbd5a523f4aafc884348f8262 (patch)
treedbb65668ba5d228c41fa5d17a887e8d323ba972e /media/base
parent2226daac070dd08be5f6c60cf464dba7fa4bd94c (diff)
downloadchromium_src-1fa37522cade3c1bbd5a523f4aafc884348f8262.zip
chromium_src-1fa37522cade3c1bbd5a523f4aafc884348f8262.tar.gz
chromium_src-1fa37522cade3c1bbd5a523f4aafc884348f8262.tar.bz2
Remove one video frame copying in video capture.
On Android, the captured frame might need to be rotated. By moving the rotation code into VideoCaptureController, one video frame copying is reduced. On Nexus 4, the frame copying from intermedia buffer to shared memory takes about 0.1 ms per frame for VGA YV12. Review URL: https://codereview.chromium.org/12378007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@185339 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'media/base')
-rw-r--r--media/base/video_util.cc4
-rw-r--r--media/base/video_util.h2
2 files changed, 3 insertions, 3 deletions
diff --git a/media/base/video_util.cc b/media/base/video_util.cc
index d7498ad..c40468f 100644
--- a/media/base/video_util.cc
+++ b/media/base/video_util.cc
@@ -86,7 +86,7 @@ void FillYUV(VideoFrame* frame, uint8 y, uint8 u, uint8 v) {
}
void RotatePlaneByPixels(
- uint8* src,
+ const uint8* src,
uint8* dest,
int width,
int height,
@@ -175,7 +175,7 @@ void RotatePlaneByPixels(
// Copy pixels.
for (int row = 0; row < num_rows; ++row) {
- uint8* src_ptr = src;
+ const uint8* src_ptr = src;
uint8* dest_ptr = dest;
for (int col = 0; col < num_cols; ++col) {
*dest_ptr = *src_ptr++;
diff --git a/media/base/video_util.h b/media/base/video_util.h
index 0be1f4c..066e7bc 100644
--- a/media/base/video_util.h
+++ b/media/base/video_util.h
@@ -49,7 +49,7 @@ MEDIA_EXPORT void FillYUV(VideoFrame* frame, uint8 y, uint8 u, uint8 v);
// ignored for both |src| and |dest|.
// The caller is responsible for blanking out the margin area.
MEDIA_EXPORT void RotatePlaneByPixels(
- uint8* src,
+ const uint8* src,
uint8* dest,
int width,
int height,