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

Unified Diff: media/video/capture/linux/v4l2_capture_delegate.h

Issue 1147693002: Send bytes_used of v4l2 captured frame when video capture (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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 | media/video/capture/linux/v4l2_capture_delegate.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/video/capture/linux/v4l2_capture_delegate.h
diff --git a/media/video/capture/linux/v4l2_capture_delegate.h b/media/video/capture/linux/v4l2_capture_delegate.h
index bd0ccad6cf73c30263474a6ca616784c3ca1e33d..9d65bb248539d708bd794e883d152810fe113fd1 100644
--- a/media/video/capture/linux/v4l2_capture_delegate.h
+++ b/media/video/capture/linux/v4l2_capture_delegate.h
@@ -66,6 +66,17 @@ class V4L2CaptureDelegate
return planes_[plane].start;
}
+ size_t GetPlanePayloadSize(size_t plane) const {
+ DCHECK_LT(plane, planes_.size());
+ return planes_[plane].payload_size;
+ }
+
+ void SetPlanePayloadSize(size_t plane, size_t payload_size) {
+ DCHECK_LT(plane, planes_.size());
+ DCHECK_LE(payload_size, planes_[plane].length);
+ planes_[plane].payload_size = payload_size;
+ }
+
protected:
friend class base::RefCounted<BufferTracker>;
virtual ~BufferTracker();
@@ -76,6 +87,7 @@ class V4L2CaptureDelegate
struct Plane {
uint8_t* start;
size_t length;
+ size_t payload_size;
};
std::vector<Plane> planes_;
};
@@ -98,6 +110,12 @@ class V4L2CaptureDelegate
// Finish filling |buffer| struct with planarity-dependent data.
virtual void FinishFillingV4L2Buffer(v4l2_buffer* buffer) const = 0;
+ // Fetch the number of bytes occupied by data in |buffer| and set to
+ // |buffer_tracker|.
+ virtual void SetPayloadSize(
+ const scoped_refptr<BufferTracker>& buffer_tracker,
+ const v4l2_buffer& buffer) const = 0;
+
// Sends the captured |buffer| to the |client_|, synchronously.
virtual void SendBuffer(
const scoped_refptr<BufferTracker>& buffer_tracker,
« no previous file with comments | « no previous file | media/video/capture/linux/v4l2_capture_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698