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

Side by Side Diff: webrtc/modules/video_coding/frame_buffer2_unittest.cc

Issue 2986893002: Piggybacking simulcast id and ALR experiment id into video content type extension. (Closed)
Patch Set: use namespace instead of struct Created 3 years, 3 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2016 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
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 98
99 // In EncodedImage |_length| is used to descibe its size and |_size| to 99 // In EncodedImage |_length| is used to descibe its size and |_size| to
100 // describe its capacity. 100 // describe its capacity.
101 void SetSize(int size) { _length = size; } 101 void SetSize(int size) { _length = size; }
102 }; 102 };
103 103
104 class VCMReceiveStatisticsCallbackMock : public VCMReceiveStatisticsCallback { 104 class VCMReceiveStatisticsCallbackMock : public VCMReceiveStatisticsCallback {
105 public: 105 public:
106 MOCK_METHOD2(OnReceiveRatesUpdated, 106 MOCK_METHOD2(OnReceiveRatesUpdated,
107 void(uint32_t bitRate, uint32_t frameRate)); 107 void(uint32_t bitRate, uint32_t frameRate));
108 MOCK_METHOD2(OnCompleteFrame, void(bool is_keyframe, size_t size_bytes)); 108 MOCK_METHOD3(OnCompleteFrame,
109 void(bool is_keyframe,
110 size_t size_bytes,
111 VideoContentType content_type));
109 MOCK_METHOD1(OnDiscardedPacketsUpdated, void(int discarded_packets)); 112 MOCK_METHOD1(OnDiscardedPacketsUpdated, void(int discarded_packets));
110 MOCK_METHOD1(OnFrameCountsUpdated, void(const FrameCounts& frame_counts)); 113 MOCK_METHOD1(OnFrameCountsUpdated, void(const FrameCounts& frame_counts));
111 MOCK_METHOD7(OnFrameBufferTimingsUpdated, 114 MOCK_METHOD7(OnFrameBufferTimingsUpdated,
112 void(int decode_ms, 115 void(int decode_ms,
113 int max_decode_ms, 116 int max_decode_ms,
114 int current_delay_ms, 117 int current_delay_ms,
115 int target_delay_ms, 118 int target_delay_ms,
116 int jitter_buffer_ms, 119 int jitter_buffer_ms,
117 int min_playout_delay_ms, 120 int min_playout_delay_ms,
118 int render_delay_ms)); 121 int render_delay_ms));
(...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after
482 ExtractFrame(); 485 ExtractFrame();
483 CheckFrame(1, pid - 1, 0); 486 CheckFrame(1, pid - 1, 0);
484 CheckNoFrame(2); 487 CheckNoFrame(2);
485 } 488 }
486 489
487 TEST_F(TestFrameBuffer2, StatsCallback) { 490 TEST_F(TestFrameBuffer2, StatsCallback) {
488 uint16_t pid = Rand(); 491 uint16_t pid = Rand();
489 uint32_t ts = Rand(); 492 uint32_t ts = Rand();
490 const int kFrameSize = 5000; 493 const int kFrameSize = 5000;
491 494
492 EXPECT_CALL(stats_callback_, OnCompleteFrame(true, kFrameSize)); 495 EXPECT_CALL(stats_callback_,
496 OnCompleteFrame(true, kFrameSize, VideoContentType::UNSPECIFIED));
493 EXPECT_CALL(stats_callback_, 497 EXPECT_CALL(stats_callback_,
494 OnFrameBufferTimingsUpdated(_, _, _, _, _, _, _)); 498 OnFrameBufferTimingsUpdated(_, _, _, _, _, _, _));
495 499
496 { 500 {
497 std::unique_ptr<FrameObjectFake> frame(new FrameObjectFake()); 501 std::unique_ptr<FrameObjectFake> frame(new FrameObjectFake());
498 frame->SetSize(kFrameSize); 502 frame->SetSize(kFrameSize);
499 frame->picture_id = pid; 503 frame->picture_id = pid;
500 frame->spatial_layer = 0; 504 frame->spatial_layer = 0;
501 frame->timestamp = ts; 505 frame->timestamp = ts;
502 frame->num_references = 0; 506 frame->num_references = 0;
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
550 ExtractFrame(0, true); 554 ExtractFrame(0, true);
551 ExtractFrame(); 555 ExtractFrame();
552 556
553 CheckFrame(0, 1, 0); 557 CheckFrame(0, 1, 0);
554 CheckFrame(1, 3, 0); 558 CheckFrame(1, 3, 0);
555 CheckNoFrame(2); 559 CheckNoFrame(2);
556 } 560 }
557 561
558 } // namespace video_coding 562 } // namespace video_coding
559 } // namespace webrtc 563 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/modules/video_coding/frame_buffer2.cc ('k') | webrtc/modules/video_coding/generic_encoder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698