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

Side by Side Diff: content/common/gpu/media/v4l2_video_decode_accelerator.h

Issue 874083005: Fix visible size for V4L2 VDA (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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 // 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 // This file contains an implementation of VideoDecodeAccelerator 5 // This file contains an implementation of VideoDecodeAccelerator
6 // that utilizes hardware video decoders, which expose Video4Linux 2 API 6 // that utilizes hardware video decoders, which expose Video4Linux 2 API
7 // (http://linuxtv.org/downloads/v4l-dvb-apis/). 7 // (http://linuxtv.org/downloads/v4l-dvb-apis/).
8 8
9 #ifndef CONTENT_COMMON_GPU_MEDIA_V4L2_VIDEO_DECODE_ACCELERATOR_H_ 9 #ifndef CONTENT_COMMON_GPU_MEDIA_V4L2_VIDEO_DECODE_ACCELERATOR_H_
10 #define CONTENT_COMMON_GPU_MEDIA_V4L2_VIDEO_DECODE_ACCELERATOR_H_ 10 #define CONTENT_COMMON_GPU_MEDIA_V4L2_VIDEO_DECODE_ACCELERATOR_H_
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after
241 241
242 void StartResolutionChangeIfNeeded(); 242 void StartResolutionChangeIfNeeded();
243 void FinishResolutionChange(); 243 void FinishResolutionChange();
244 244
245 // Try to get output format, detected after parsing the beginning 245 // Try to get output format, detected after parsing the beginning
246 // of the stream. Sets |again| to true if more parsing is needed. 246 // of the stream. Sets |again| to true if more parsing is needed.
247 bool GetFormatInfo(struct v4l2_format* format, bool* again); 247 bool GetFormatInfo(struct v4l2_format* format, bool* again);
248 // Create output buffers for the given |format|. 248 // Create output buffers for the given |format|.
249 bool CreateBuffersForFormat(const struct v4l2_format& format); 249 bool CreateBuffersForFormat(const struct v4l2_format& format);
250 250
251 // Try to get |crop_size|. Return false if cropping is not supported or the
252 // crop size is not inside |buffer_size|.
253 bool GetCropSize(const gfx::Size& buffer_size, gfx::Size* crop_size);
254
251 // 255 //
252 // Device tasks, to be run on device_poll_thread_. 256 // Device tasks, to be run on device_poll_thread_.
253 // 257 //
254 258
255 // The device task. 259 // The device task.
256 void DevicePollTask(bool poll_device); 260 void DevicePollTask(bool poll_device);
257 261
258 // 262 //
259 // Safe from any thread. 263 // Safe from any thread.
260 // 264 //
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
411 // The number of pictures that are sent to PictureReady and will be cleared. 415 // The number of pictures that are sent to PictureReady and will be cleared.
412 int picture_clearing_count_; 416 int picture_clearing_count_;
413 417
414 // Used by the decoder thread to wait for AssignPictureBuffers to arrive 418 // Used by the decoder thread to wait for AssignPictureBuffers to arrive
415 // to avoid races with potential Reset requests. 419 // to avoid races with potential Reset requests.
416 base::WaitableEvent pictures_assigned_; 420 base::WaitableEvent pictures_assigned_;
417 421
418 // Output picture size. 422 // Output picture size.
419 gfx::Size frame_buffer_size_; 423 gfx::Size frame_buffer_size_;
420 424
425 // Output picture visible size.
426 gfx::Size frame_visible_size_;
Pawel Osciak 2015/01/29 05:02:04 Please use visible_size_ and rename frame_buffer_s
kcwu 2015/01/29 09:33:11 Done.
427
421 // 428 //
422 // The device polling thread handles notifications of V4L2 device changes. 429 // The device polling thread handles notifications of V4L2 device changes.
423 // 430 //
424 431
425 // The thread. 432 // The thread.
426 base::Thread device_poll_thread_; 433 base::Thread device_poll_thread_;
427 434
428 // 435 //
429 // Other state, held by the child (main) thread. 436 // Other state, held by the child (main) thread.
430 // 437 //
(...skipping 12 matching lines...) Expand all
443 450
444 // The WeakPtrFactory for |weak_this_|. 451 // The WeakPtrFactory for |weak_this_|.
445 base::WeakPtrFactory<V4L2VideoDecodeAccelerator> weak_this_factory_; 452 base::WeakPtrFactory<V4L2VideoDecodeAccelerator> weak_this_factory_;
446 453
447 DISALLOW_COPY_AND_ASSIGN(V4L2VideoDecodeAccelerator); 454 DISALLOW_COPY_AND_ASSIGN(V4L2VideoDecodeAccelerator);
448 }; 455 };
449 456
450 } // namespace content 457 } // namespace content
451 458
452 #endif // CONTENT_COMMON_GPU_MEDIA_V4L2_VIDEO_DECODE_ACCELERATOR_H_ 459 #endif // CONTENT_COMMON_GPU_MEDIA_V4L2_VIDEO_DECODE_ACCELERATOR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698