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

Unified Diff: media/video/capture/mac/video_capture_device_avfoundation_mac.mm

Issue 1089173003: Revert of Mac Video Capture AVFoundation: Calculate compressed frame size for MJPEG. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 months 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/video/capture/mac/video_capture_device_avfoundation_mac.mm
diff --git a/media/video/capture/mac/video_capture_device_avfoundation_mac.mm b/media/video/capture/mac/video_capture_device_avfoundation_mac.mm
index 6d71ef82541fed91eac444d1dfca74254f227d01..f3c7ca76bd283694c1ef9cda38430123222b59b6 100644
--- a/media/video/capture/mac/video_capture_device_avfoundation_mac.mm
+++ b/media/video/capture/mac/video_capture_device_avfoundation_mac.mm
@@ -5,8 +5,6 @@
#import "media/video/capture/mac/video_capture_device_avfoundation_mac.h"
#import <CoreVideo/CoreVideo.h>
-
-#include <cstring> // For memchr.
#include "base/logging.h"
#include "base/mac/foundation_util.h"
@@ -30,21 +28,6 @@
default:
return media::PIXEL_FORMAT_UNKNOWN;
}
-}
-
-// TODO(magjed): Remove this when Chromium has the latest libyuv version.
-// Returns frame size by finding the End Of Image marker, or 0 if not found.
-size_t JpegFrameSize(const char* sample, size_t sampleSize) {
- // Jump to next marker (0xff), check for End Of Image (0xd9), repeat.
- const char* end = sample + sampleSize - 1;
- for (const char* it = sample;
- (it = static_cast<const char*>(memchr(it, 0xff, end - it)));
- ++it) {
- if (it[1] == static_cast<char>(0xd9))
- return 2 + (it - sample);
- }
- DLOG(WARNING) << "JPEG End Of Image (EOI) marker not found.";
- return 0;
}
@implementation VideoCaptureDeviceAVFoundation
@@ -323,16 +306,6 @@
// Expect the MJPEG data to be available as a contiguous reference, i.e.
// not covered by multiple memory blocks.
CHECK_EQ(lengthAtOffset, frameSize);
-
- // TODO(magjed): Remove this when Chromium has the latest libyuv version.
- // If |frameSize| is suspiciously high (>= 8 bpp), calculate the actual
- // size by finding the end of image marker. The purpose is to speed up the
- // jpeg decoding in the browser.
- if (static_cast<int>(frameSize) >= dimensions.width * dimensions.height)
- frameSize = JpegFrameSize(baseAddress, frameSize);
-
- if (frameSize == 0)
- return;
}
} else {
videoFrame = CoreMediaGlue::CMSampleBufferGetImageBuffer(sampleBuffer);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698