OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "media/remoting/fake_media_resource.h" | 5 #include "media/remoting/fake_media_resource.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/callback_helpers.h" | 9 #include "base/callback_helpers.h" |
10 #include "media/base/decoder_buffer.h" | 10 #include "media/base/decoder_buffer.h" |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 } | 65 } |
66 | 66 |
67 bool FakeDemuxerStream::SupportsConfigChanges() { | 67 bool FakeDemuxerStream::SupportsConfigChanges() { |
68 return false; | 68 return false; |
69 } | 69 } |
70 | 70 |
71 VideoRotation FakeDemuxerStream::video_rotation() { | 71 VideoRotation FakeDemuxerStream::video_rotation() { |
72 return VIDEO_ROTATION_0; | 72 return VIDEO_ROTATION_0; |
73 } | 73 } |
74 | 74 |
75 bool FakeDemuxerStream::enabled() const { | |
76 return true; | |
77 } | |
78 | |
79 void FakeDemuxerStream::CreateFakeFrame(size_t size, | 75 void FakeDemuxerStream::CreateFakeFrame(size_t size, |
80 bool key_frame, | 76 bool key_frame, |
81 int pts_ms) { | 77 int pts_ms) { |
82 std::vector<uint8_t> buffer(size); | 78 std::vector<uint8_t> buffer(size); |
83 // Assign each byte in the buffer its index mod 256. | 79 // Assign each byte in the buffer its index mod 256. |
84 for (size_t i = 0; i < size; ++i) { | 80 for (size_t i = 0; i < size; ++i) { |
85 buffer[i] = static_cast<uint8_t>(i & 0xFF); | 81 buffer[i] = static_cast<uint8_t>(i & 0xFF); |
86 } | 82 } |
87 base::TimeDelta pts = base::TimeDelta::FromMilliseconds(pts_ms); | 83 base::TimeDelta pts = base::TimeDelta::FromMilliseconds(pts_ms); |
88 | 84 |
(...skipping 23 matching lines...) Expand all Loading... |
112 return streams; | 108 return streams; |
113 } | 109 } |
114 | 110 |
115 void FakeMediaResource::SetStreamStatusChangeCB( | 111 void FakeMediaResource::SetStreamStatusChangeCB( |
116 const StreamStatusChangeCB& cb) { | 112 const StreamStatusChangeCB& cb) { |
117 NOTIMPLEMENTED(); | 113 NOTIMPLEMENTED(); |
118 } | 114 } |
119 | 115 |
120 } // namespace remoting | 116 } // namespace remoting |
121 } // namespace media | 117 } // namespace media |
OLD | NEW |