OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 <dlfcn.h> | 5 #include <dlfcn.h> |
6 #include <errno.h> | 6 #include <errno.h> |
7 #include <fcntl.h> | 7 #include <fcntl.h> |
8 #include <linux/videodev2.h> | 8 #include <linux/videodev2.h> |
9 #include <poll.h> | 9 #include <poll.h> |
10 #include <sys/eventfd.h> | 10 #include <sys/eventfd.h> |
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
198 | 198 |
199 DestroyInputBuffers(); | 199 DestroyInputBuffers(); |
200 DestroyOutputBuffers(); | 200 DestroyOutputBuffers(); |
201 | 201 |
202 // These maps have members that should be manually destroyed, e.g. file | 202 // These maps have members that should be manually destroyed, e.g. file |
203 // descriptors, mmap() segments, etc. | 203 // descriptors, mmap() segments, etc. |
204 DCHECK(input_buffer_map_.empty()); | 204 DCHECK(input_buffer_map_.empty()); |
205 DCHECK(output_buffer_map_.empty()); | 205 DCHECK(output_buffer_map_.empty()); |
206 } | 206 } |
207 | 207 |
| 208 // static |
| 209 std::vector<media::VideoDecodeAccelerator::SupportedProfile> |
| 210 V4L2VideoDecodeAccelerator::GetSupportedProfiles() { |
| 211 std::vector<SupportedProfile> profiles; |
| 212 SupportedProfile profile; |
| 213 profile.min_resolution.SetSize(1, 1); |
| 214 // NOTE: additional autodetection logic may require updating input buffer size |
| 215 // selection in platform-specific implementations, such as |
| 216 // V4L2VideoDecodeAccelerator. |
| 217 profile.max_resolution.SetSize(1920, 1088); |
| 218 profile.profile = media::VP8PROFILE_ANY; |
| 219 profiles.push_back(profile); |
| 220 profile.profile = media::H264PROFILE_MAIN; |
| 221 profiles.push_back(profile); |
| 222 return profiles; |
| 223 } |
| 224 |
208 bool V4L2VideoDecodeAccelerator::Initialize(media::VideoCodecProfile profile, | 225 bool V4L2VideoDecodeAccelerator::Initialize(media::VideoCodecProfile profile, |
209 Client* client) { | 226 Client* client) { |
210 DVLOG(3) << "Initialize()"; | 227 DVLOG(3) << "Initialize()"; |
211 DCHECK(child_message_loop_proxy_->BelongsToCurrentThread()); | 228 DCHECK(child_message_loop_proxy_->BelongsToCurrentThread()); |
212 DCHECK_EQ(decoder_state_, kUninitialized); | 229 DCHECK_EQ(decoder_state_, kUninitialized); |
213 | 230 |
214 client_ptr_factory_.reset(new base::WeakPtrFactory<Client>(client)); | 231 client_ptr_factory_.reset(new base::WeakPtrFactory<Client>(client)); |
215 client_ = client_ptr_factory_->GetWeakPtr(); | 232 client_ = client_ptr_factory_->GetWeakPtr(); |
216 | 233 |
217 switch (profile) { | 234 switch (profile) { |
(...skipping 1716 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1934 gfx::Size new_size(base::checked_cast<int>(format.fmt.pix_mp.width), | 1951 gfx::Size new_size(base::checked_cast<int>(format.fmt.pix_mp.width), |
1935 base::checked_cast<int>(format.fmt.pix_mp.height)); | 1952 base::checked_cast<int>(format.fmt.pix_mp.height)); |
1936 if (frame_buffer_size_ != new_size) { | 1953 if (frame_buffer_size_ != new_size) { |
1937 DVLOG(3) << "IsResolutionChangeNecessary(): Resolution change detected"; | 1954 DVLOG(3) << "IsResolutionChangeNecessary(): Resolution change detected"; |
1938 return true; | 1955 return true; |
1939 } | 1956 } |
1940 return false; | 1957 return false; |
1941 } | 1958 } |
1942 | 1959 |
1943 } // namespace content | 1960 } // namespace content |
OLD | NEW |