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

Side by Side Diff: webrtc/modules/video_coding/codecs/vp8/vp8_sequence_coder.cc

Issue 1414693006: Add DecodedImageCallback::Decoded() function with custom decode time value. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: addressed comments. Created 5 years, 1 month 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
11 #include "testing/gtest/include/gtest/gtest.h" 11 #include "testing/gtest/include/gtest/gtest.h"
12 #include "webrtc/base/checks.h"
12 #include "webrtc/base/scoped_ptr.h" 13 #include "webrtc/base/scoped_ptr.h"
13 #include "webrtc/common_video/interface/video_image.h" 14 #include "webrtc/common_video/interface/video_image.h"
14 #include "webrtc/common_video/libyuv/include/webrtc_libyuv.h" 15 #include "webrtc/common_video/libyuv/include/webrtc_libyuv.h"
15 #include "webrtc/modules/video_coding/codecs/vp8/include/vp8.h" 16 #include "webrtc/modules/video_coding/codecs/vp8/include/vp8.h"
16 #include "webrtc/system_wrappers/include/tick_util.h" 17 #include "webrtc/system_wrappers/include/tick_util.h"
17 #include "webrtc/test/testsupport/fileutils.h" 18 #include "webrtc/test/testsupport/fileutils.h"
18 #include "webrtc/test/testsupport/metrics/video_metrics.h" 19 #include "webrtc/test/testsupport/metrics/video_metrics.h"
19 #include "webrtc/tools/simple_command_line_parser.h" 20 #include "webrtc/tools/simple_command_line_parser.h"
20 #include "webrtc/video_frame.h" 21 #include "webrtc/video_frame.h"
21 22
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 } 62 }
62 encoded_bytes_ += encoded_image_._length; 63 encoded_bytes_ += encoded_image_._length;
63 return 0; 64 return 0;
64 } 65 }
65 66
66 // TODO(mikhal): Add support for varying the frame size. 67 // TODO(mikhal): Add support for varying the frame size.
67 class Vp8SequenceCoderDecodeCallback : public webrtc::DecodedImageCallback { 68 class Vp8SequenceCoderDecodeCallback : public webrtc::DecodedImageCallback {
68 public: 69 public:
69 explicit Vp8SequenceCoderDecodeCallback(FILE* decoded_file) 70 explicit Vp8SequenceCoderDecodeCallback(FILE* decoded_file)
70 : decoded_file_(decoded_file) {} 71 : decoded_file_(decoded_file) {}
71 int Decoded(webrtc::VideoFrame& frame); 72 int32_t Decoded(webrtc::VideoFrame& frame) override;
73 int32_t Decoded(webrtc::VideoFrame& frame, int64_t decode_time_ms) override {
74 RTC_NOTREACHED();
75 return -1;;
76 }
72 bool DecodeComplete(); 77 bool DecodeComplete();
73 78
74 private: 79 private:
75 FILE* decoded_file_; 80 FILE* decoded_file_;
76 }; 81 };
77 82
78 int Vp8SequenceCoderDecodeCallback::Decoded(webrtc::VideoFrame& image) { 83 int Vp8SequenceCoderDecodeCallback::Decoded(webrtc::VideoFrame& image) {
79 EXPECT_EQ(0, webrtc::PrintVideoFrame(image, decoded_file_)); 84 EXPECT_EQ(0, webrtc::PrintVideoFrame(image, decoded_file_));
80 return 0; 85 return 0;
81 } 86 }
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
229 234
230 parser.ProcessFlags(); 235 parser.ProcessFlags();
231 if (parser.GetFlag("help") == "true") { 236 if (parser.GetFlag("help") == "true") {
232 parser.PrintUsageMessage(); 237 parser.PrintUsageMessage();
233 exit(EXIT_SUCCESS); 238 exit(EXIT_SUCCESS);
234 } 239 }
235 parser.PrintEnteredFlags(); 240 parser.PrintEnteredFlags();
236 241
237 return SequenceCoder(parser); 242 return SequenceCoder(parser);
238 } 243 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698