| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_GPU_AVDA_PICTURE_BUFFER_MANAGER_H_ | 5 #ifndef MEDIA_GPU_AVDA_PICTURE_BUFFER_MANAGER_H_ |
| 6 #define MEDIA_GPU_AVDA_PICTURE_BUFFER_MANAGER_H_ | 6 #define MEDIA_GPU_AVDA_PICTURE_BUFFER_MANAGER_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 explicit AVDAPictureBufferManager(AVDAStateProvider* state_provider); | 42 explicit AVDAPictureBufferManager(AVDAStateProvider* state_provider); |
| 43 virtual ~AVDAPictureBufferManager(); | 43 virtual ~AVDAPictureBufferManager(); |
| 44 | 44 |
| 45 // Must be called before anything else. If |surface_id| is |kNoSurfaceID| | 45 // Must be called before anything else. If |surface_id| is |kNoSurfaceID| |
| 46 // then a new SurfaceTexture will be returned. Otherwise, the corresponding | 46 // then a new SurfaceTexture will be returned. Otherwise, the corresponding |
| 47 // SurfaceView will be returned. | 47 // SurfaceView will be returned. |
| 48 // | 48 // |
| 49 // May be called multiple times to switch to a new |surface_id|. Picture | 49 // May be called multiple times to switch to a new |surface_id|. Picture |
| 50 // buffers will be updated to use the new surface during the call to | 50 // buffers will be updated to use the new surface during the call to |
| 51 // UseCodecBufferForPictureBuffer(). | 51 // UseCodecBufferForPictureBuffer(). |
| 52 gl::ScopedJavaSurface Initialize(int surface_id); | 52 // TODO(liberato); update comment. |
| 53 void InitializeForOverlay(); |
| 54 gl::ScopedJavaSurface InitializeForSurfaceTexture(); |
| 53 | 55 |
| 54 void Destroy(const PictureBufferMap& buffers); | 56 void Destroy(const PictureBufferMap& buffers); |
| 55 | 57 |
| 56 // Sets up |picture_buffer| so that its texture will refer to the image that | 58 // Sets up |picture_buffer| so that its texture will refer to the image that |
| 57 // is represented by the decoded output buffer at codec_buffer_index. | 59 // is represented by the decoded output buffer at codec_buffer_index. |
| 58 void UseCodecBufferForPictureBuffer(int32_t codec_buffer_index, | 60 void UseCodecBufferForPictureBuffer(int32_t codec_buffer_index, |
| 59 const PictureBuffer& picture_buffer); | 61 const PictureBuffer& picture_buffer); |
| 60 | 62 |
| 61 // Assigns a picture buffer and attaches an image to its texture. | 63 // Assigns a picture buffer and attaches an image to its texture. |
| 62 void AssignOnePictureBuffer(const PictureBuffer& picture_buffer, | 64 void AssignOnePictureBuffer(const PictureBuffer& picture_buffer, |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 | 122 |
| 121 // Maps a picture buffer id to a AVDACodecImage. | 123 // Maps a picture buffer id to a AVDACodecImage. |
| 122 std::map<int, scoped_refptr<AVDACodecImage>> codec_images_; | 124 std::map<int, scoped_refptr<AVDACodecImage>> codec_images_; |
| 123 | 125 |
| 124 DISALLOW_COPY_AND_ASSIGN(AVDAPictureBufferManager); | 126 DISALLOW_COPY_AND_ASSIGN(AVDAPictureBufferManager); |
| 125 }; | 127 }; |
| 126 | 128 |
| 127 } // namespace media | 129 } // namespace media |
| 128 | 130 |
| 129 #endif // MEDIA_GPU_AVDA_PICTURE_BUFFER_MANAGER_H_ | 131 #endif // MEDIA_GPU_AVDA_PICTURE_BUFFER_MANAGER_H_ |
| OLD | NEW |