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

Unified Diff: webrtc/modules/video_coding/codecs/test/videoprocessor.h

Issue 2995513002: Minor improvements to VideoProcessor and corresponding test. (Closed)
Patch Set: Fix compile. Created 3 years, 4 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
Index: webrtc/modules/video_coding/codecs/test/videoprocessor.h
diff --git a/webrtc/modules/video_coding/codecs/test/videoprocessor.h b/webrtc/modules/video_coding/codecs/test/videoprocessor.h
index d0b21de5858c46758a8f48199c39d86626b68c28..2775e0a8d5a4ea58de64227183530d10da0487ee 100644
--- a/webrtc/modules/video_coding/codecs/test/videoprocessor.h
+++ b/webrtc/modules/video_coding/codecs/test/videoprocessor.h
@@ -136,6 +136,8 @@ struct TestConfig {
//
// Note this class is not thread safe in any way and is meant for simple testing
// purposes.
+//
+// TODO(brandtr): Remove this interface.
class VideoProcessor {
public:
virtual ~VideoProcessor() {}
@@ -183,9 +185,18 @@ class VideoProcessorImpl : public VideoProcessor {
FrameWriter* source_frame_writer,
IvfFileWriter* encoded_frame_writer,
FrameWriter* decoded_frame_writer);
- virtual ~VideoProcessorImpl();
+ ~VideoProcessorImpl() override;
+
+ // Implements VideoProcessor.
void Init() override;
bool ProcessFrame(int frame_number) override;
+ void SetRates(int bit_rate, int frame_rate) override;
+ size_t EncodedFrameSize(int frame_number) override;
+ FrameType EncodedFrameType(int frame_number) override;
+ int GetQpFromEncoder(int frame_number) override;
+ int GetQpFromBitstream(int frame_number) override;
+ int NumberDroppedFrames() override;
+ int NumberSpatialResizes() override;
private:
// Container that holds per-frame information that needs to be stored between
@@ -255,8 +266,7 @@ class VideoProcessorImpl : public VideoProcessor {
void Decoded(webrtc::VideoFrame& image,
rtc::Optional<int32_t> decode_time_ms,
rtc::Optional<uint8_t> qp) override {
- Decoded(image,
- decode_time_ms ? static_cast<int32_t>(*decode_time_ms) : -1);
+ Decoded(image);
}
private:
@@ -271,26 +281,11 @@ class VideoProcessorImpl : public VideoProcessor {
// Invoked by the callback when a frame has completed decoding.
void FrameDecoded(const webrtc::VideoFrame& image);
- // Updates the encoder with the target bit rate and the frame rate.
- void SetRates(int bit_rate, int frame_rate) override;
-
- // Return the size of the encoded frame in bytes.
- size_t EncodedFrameSize(int frame_number) override;
-
- // Return the encoded frame type (key or delta).
- FrameType EncodedFrameType(int frame_number) override;
-
- // Return the qp used by encoder.
- int GetQpFromEncoder(int frame_number) override;
-
- // Return the qp from the qp parser.
- int GetQpFromBitstream(int frame_number) override;
-
- // Return the number of dropped frames.
- int NumberDroppedFrames() override;
-
- // Return the number of spatial resizes.
- int NumberSpatialResizes() override;
+ // Use the frame number as the basis for timestamp to identify frames. Let the
+ // first timestamp be non-zero, to not make the IvfFileWriter believe that we
+ // want to use capture timestamps in the IVF files.
+ uint32_t FrameNumberToTimestamp(int frame_number);
+ int TimestampToFrameNumber(uint32_t timestamp);
webrtc::VideoEncoder* const encoder_;
webrtc::VideoDecoder* const decoder_;
« no previous file with comments | « webrtc/modules/video_coding/codecs/test/stats.cc ('k') | webrtc/modules/video_coding/codecs/test/videoprocessor.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698