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 #ifndef MEDIA_BASE_VIDEO_FRAME_H_ | 5 #ifndef MEDIA_BASE_VIDEO_FRAME_H_ |
6 #define MEDIA_BASE_VIDEO_FRAME_H_ | 6 #define MEDIA_BASE_VIDEO_FRAME_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
(...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
386 // This method is thread safe. Both blink and compositor threads can call it. | 386 // This method is thread safe. Both blink and compositor threads can call it. |
387 void UpdateReleaseSyncToken(SyncTokenClient* client); | 387 void UpdateReleaseSyncToken(SyncTokenClient* client); |
388 | 388 |
389 // Returns a human-readable string describing |*this|. | 389 // Returns a human-readable string describing |*this|. |
390 std::string AsHumanReadableString(); | 390 std::string AsHumanReadableString(); |
391 | 391 |
392 // Unique identifier for this video frame; generated at construction time and | 392 // Unique identifier for this video frame; generated at construction time and |
393 // guaranteed to be unique within a single process. | 393 // guaranteed to be unique within a single process. |
394 int unique_id() const { return unique_id_; } | 394 int unique_id() const { return unique_id_; } |
395 | 395 |
| 396 // Returns the number of bits per channel for given |format|. |
| 397 int BitsPerChannel(VideoPixelFormat format); |
| 398 |
396 protected: | 399 protected: |
397 friend class base::RefCountedThreadSafe<VideoFrame>; | 400 friend class base::RefCountedThreadSafe<VideoFrame>; |
398 | 401 |
399 // Clients must use the static factory/wrapping methods to create a new frame. | 402 // Clients must use the static factory/wrapping methods to create a new frame. |
400 // Derived classes should create their own factory/wrapping methods, and use | 403 // Derived classes should create their own factory/wrapping methods, and use |
401 // this constructor to do basic initialization. | 404 // this constructor to do basic initialization. |
402 VideoFrame(VideoPixelFormat format, | 405 VideoFrame(VideoPixelFormat format, |
403 StorageType storage_type, | 406 StorageType storage_type, |
404 const gfx::Size& coded_size, | 407 const gfx::Size& coded_size, |
405 const gfx::Rect& visible_rect, | 408 const gfx::Rect& visible_rect, |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
542 const int unique_id_; | 545 const int unique_id_; |
543 | 546 |
544 gfx::ColorSpace color_space_; | 547 gfx::ColorSpace color_space_; |
545 | 548 |
546 DISALLOW_IMPLICIT_CONSTRUCTORS(VideoFrame); | 549 DISALLOW_IMPLICIT_CONSTRUCTORS(VideoFrame); |
547 }; | 550 }; |
548 | 551 |
549 } // namespace media | 552 } // namespace media |
550 | 553 |
551 #endif // MEDIA_BASE_VIDEO_FRAME_H_ | 554 #endif // MEDIA_BASE_VIDEO_FRAME_H_ |
OLD | NEW |