Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(309)

Unified Diff: tools/telemetry/telemetry/core/video.py

Issue 668753002: [Telemetry] Migrate bitmap.py from bitmaptools.cc to numpy (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/telemetry/telemetry/core/tab_unittest.py ('k') | tools/telemetry/telemetry/core/video_unittest.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/telemetry/telemetry/core/video.py
diff --git a/tools/telemetry/telemetry/core/video.py b/tools/telemetry/telemetry/core/video.py
index 4eb4cab3bbcf3714d1e69d18644de58d5c24ecd2..9444b509a0d39dcd9468c353e049d16d352fbfd7 100644
--- a/tools/telemetry/telemetry/core/video.py
+++ b/tools/telemetry/telemetry/core/video.py
@@ -4,11 +4,12 @@
import subprocess
-from telemetry.core import bitmap
from telemetry.core import platform
+from telemetry.image_processing import image_util
+from telemetry.image_processing import rgba_color
from telemetry.util import cloud_storage
-HIGHLIGHT_ORANGE_FRAME = bitmap.WEB_PAGE_TEST_ORANGE
+HIGHLIGHT_ORANGE_FRAME = rgba_color.WEB_PAGE_TEST_ORANGE
class BoundingBoxNotFoundException(Exception):
pass
@@ -38,10 +39,11 @@ class Video(object):
tab content boundaries and then omits all frames displaying the flash.
Yields:
- (time_ms, bitmap) tuples representing each video keyframe. Only the first
- frame in a run of sequential duplicate bitmaps is typically included.
+ (time_ms, image) tuples representing each video keyframe. Only the first
+ frame is a run of sequential duplicate bitmaps is typically included.
time_ms is milliseconds since navigationStart.
- bitmap is a telemetry.core.Bitmap.
+ image may be a telemetry.core.Bitmap, or a numpy array depending on
+ whether numpy is installed.
"""
frame_generator = self._FramesFromMp4(self._video_file_obj.name)
@@ -166,4 +168,4 @@ class Video(object):
raise StopIteration
assert num_read == len(frame_data), 'Unexpected frame size: %d' % num_read
yield (GetFrameTimestampMs(proc.stderr),
- bitmap.Bitmap(3, dimensions[0], dimensions[1], frame_data))
+ image_util.FromRGBPixels(dimensions[0], dimensions[1], frame_data))
« no previous file with comments | « tools/telemetry/telemetry/core/tab_unittest.py ('k') | tools/telemetry/telemetry/core/video_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698