OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "content/browser/renderer_host/media/video_capture_controller.h" | 5 #include "content/browser/renderer_host/media/video_capture_controller.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 #include <string.h> | 8 #include <string.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 } | 81 } |
82 void OnBufferDestroyed(VideoCaptureControllerID id, int buffer_id) override { | 82 void OnBufferDestroyed(VideoCaptureControllerID id, int buffer_id) override { |
83 DoBufferDestroyed(id, buffer_id); | 83 DoBufferDestroyed(id, buffer_id); |
84 } | 84 } |
85 void OnBufferReady( | 85 void OnBufferReady( |
86 VideoCaptureControllerID id, | 86 VideoCaptureControllerID id, |
87 int buffer_id, | 87 int buffer_id, |
88 const media::mojom::VideoFrameInfoPtr& frame_info) override { | 88 const media::mojom::VideoFrameInfoPtr& frame_info) override { |
89 EXPECT_EQ(expected_pixel_format_, frame_info->pixel_format); | 89 EXPECT_EQ(expected_pixel_format_, frame_info->pixel_format); |
90 media::VideoFrameMetadata metadata; | 90 media::VideoFrameMetadata metadata; |
91 metadata.MergeInternalValuesFrom(*frame_info->metadata); | 91 metadata.MergeInternalValuesFrom(frame_info->metadata); |
92 base::TimeTicks reference_time; | 92 base::TimeTicks reference_time; |
93 EXPECT_TRUE(metadata.GetTimeTicks(media::VideoFrameMetadata::REFERENCE_TIME, | 93 EXPECT_TRUE(metadata.GetTimeTicks(media::VideoFrameMetadata::REFERENCE_TIME, |
94 &reference_time)); | 94 &reference_time)); |
95 DoBufferReady(id, frame_info->coded_size); | 95 DoBufferReady(id, frame_info->coded_size); |
96 if (enable_auto_return_buffer_on_buffer_ready_) { | 96 if (enable_auto_return_buffer_on_buffer_ready_) { |
97 base::ThreadTaskRunnerHandle::Get()->PostTask( | 97 base::ThreadTaskRunnerHandle::Get()->PostTask( |
98 FROM_HERE, base::Bind(&VideoCaptureController::ReturnBuffer, | 98 FROM_HERE, base::Bind(&VideoCaptureController::ReturnBuffer, |
99 base::Unretained(controller_), id, this, | 99 base::Unretained(controller_), id, this, |
100 buffer_id, resource_utilization_)); | 100 buffer_id, resource_utilization_)); |
101 } | 101 } |
(...skipping 761 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
863 EXPECT_CALL(*client_b_, OnStarted(_)); | 863 EXPECT_CALL(*client_b_, OnStarted(_)); |
864 device_client_->OnStarted(); | 864 device_client_->OnStarted(); |
865 | 865 |
866 // VideoCaptureController will take care of the OnStarted event for the | 866 // VideoCaptureController will take care of the OnStarted event for the |
867 // clients who join later. | 867 // clients who join later. |
868 EXPECT_CALL(*client_a_, OnStarted(_)); | 868 EXPECT_CALL(*client_a_, OnStarted(_)); |
869 controller_->AddClient(client_a_route_2, client_a_.get(), 200, session_200); | 869 controller_->AddClient(client_a_route_2, client_a_.get(), 200, session_200); |
870 } | 870 } |
871 } | 871 } |
872 } // namespace content | 872 } // namespace content |
OLD | NEW |