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

Side by Side Diff: media/gpu/avda_picture_buffer_manager.h

Issue 2629223003: media: Ensure MediaCodecs are released before attached SurfaceTextures (Closed)
Patch Set: more comments Created 3 years, 11 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 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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 // MediaCodec is being destroyed. Previously provided codecs should no longer 75 // MediaCodec is being destroyed. Previously provided codecs should no longer
76 // be referenced. 76 // be referenced.
77 void CodecChanged(VideoCodecBridge* codec); 77 void CodecChanged(VideoCodecBridge* codec);
78 78
79 // Whether the pictures buffers are overlayable. 79 // Whether the pictures buffers are overlayable.
80 bool ArePicturesOverlayable(); 80 bool ArePicturesOverlayable();
81 81
82 // Are there any unrendered picture buffers oustanding? 82 // Are there any unrendered picture buffers oustanding?
83 bool HasUnrenderedPictures() const; 83 bool HasUnrenderedPictures() const;
84 84
85 scoped_refptr<gl::SurfaceTexture> surface_texture() {
86 return surface_texture_;
87 }
88
85 // Returns the GL texture target that the PictureBuffer textures use. 89 // Returns the GL texture target that the PictureBuffer textures use.
86 // Always use OES textures even though this will cause flickering in dev tools 90 // Always use OES textures even though this will cause flickering in dev tools
87 // when inspecting a fullscreen video. See http://crbug.com/592798 91 // when inspecting a fullscreen video. See http://crbug.com/592798
88 static constexpr GLenum kTextureTarget = GL_TEXTURE_EXTERNAL_OES; 92 static constexpr GLenum kTextureTarget = GL_TEXTURE_EXTERNAL_OES;
89 93
90 private: 94 private:
91 // Release any codec buffer that is associated with the given picture buffer 95 // Release any codec buffer that is associated with the given picture buffer
92 // back to the codec. It is okay if there is no such buffer. 96 // back to the codec. It is okay if there is no such buffer.
93 void ReleaseCodecBufferForPicture(const PictureBuffer& picture_buffer); 97 void ReleaseCodecBufferForPicture(const PictureBuffer& picture_buffer);
94 98
(...skipping 21 matching lines...) Expand all
116 120
117 // Maps a picture buffer id to a AVDACodecImage. 121 // Maps a picture buffer id to a AVDACodecImage.
118 std::map<int, scoped_refptr<AVDACodecImage>> codec_images_; 122 std::map<int, scoped_refptr<AVDACodecImage>> codec_images_;
119 123
120 DISALLOW_COPY_AND_ASSIGN(AVDAPictureBufferManager); 124 DISALLOW_COPY_AND_ASSIGN(AVDAPictureBufferManager);
121 }; 125 };
122 126
123 } // namespace media 127 } // namespace media
124 128
125 #endif // MEDIA_GPU_AVDA_PICTURE_BUFFER_MANAGER_H_ 129 #endif // MEDIA_GPU_AVDA_PICTURE_BUFFER_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698