| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_MEDIA_FOUNDATION_VIDEO_ENCODE_ACCELERATOR_WIN_H_ | 5 #ifndef MEDIA_GPU_MEDIA_FOUNDATION_VIDEO_ENCODE_ACCELERATOR_WIN_H_ |
| 6 #define MEDIA_GPU_MEDIA_FOUNDATION_VIDEO_ENCODE_ACCELERATOR_WIN_H_ | 6 #define MEDIA_GPU_MEDIA_FOUNDATION_VIDEO_ENCODE_ACCELERATOR_WIN_H_ |
| 7 | 7 |
| 8 #include <mfapi.h> | 8 #include <mfapi.h> |
| 9 #include <mfidl.h> | 9 #include <mfidl.h> |
| 10 #include <stdint.h> | 10 #include <stdint.h> |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 | 69 |
| 70 // Creates an hardware encoder backed IMFTransform instance on |encoder_|. | 70 // Creates an hardware encoder backed IMFTransform instance on |encoder_|. |
| 71 bool CreateHardwareEncoderMFT(); | 71 bool CreateHardwareEncoderMFT(); |
| 72 | 72 |
| 73 // Initializes and allocates memory for input and output samples. | 73 // Initializes and allocates memory for input and output samples. |
| 74 bool InitializeInputOutputSamples(); | 74 bool InitializeInputOutputSamples(); |
| 75 | 75 |
| 76 // Initializes encoder parameters for real-time use. | 76 // Initializes encoder parameters for real-time use. |
| 77 bool SetEncoderModes(); | 77 bool SetEncoderModes(); |
| 78 | 78 |
| 79 // Returns true if we can initialize input and output samples with the given |
| 80 // frame size, otherwise false. |
| 81 bool IsResolutionSupported(const gfx::Size& size); |
| 82 |
| 79 // Helper function to notify the client of an error on | 83 // Helper function to notify the client of an error on |
| 80 // |main_client_task_runner_|. | 84 // |main_client_task_runner_|. |
| 81 void NotifyError(VideoEncodeAccelerator::Error error); | 85 void NotifyError(VideoEncodeAccelerator::Error error); |
| 82 | 86 |
| 83 // Encoding tasks to be run on |encoder_thread_|. | 87 // Encoding tasks to be run on |encoder_thread_|. |
| 84 void EncodeTask(scoped_refptr<VideoFrame> frame, bool force_keyframe); | 88 void EncodeTask(scoped_refptr<VideoFrame> frame, bool force_keyframe); |
| 85 | 89 |
| 86 // Checks for and copies encoded output on |encoder_thread_|. | 90 // Checks for and copies encoded output on |encoder_thread_|. |
| 87 void ProcessOutput(); | 91 void ProcessOutput(); |
| 88 | 92 |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 154 // other destructors run. | 158 // other destructors run. |
| 155 base::WeakPtrFactory<MediaFoundationVideoEncodeAccelerator> | 159 base::WeakPtrFactory<MediaFoundationVideoEncodeAccelerator> |
| 156 encoder_task_weak_factory_; | 160 encoder_task_weak_factory_; |
| 157 | 161 |
| 158 DISALLOW_COPY_AND_ASSIGN(MediaFoundationVideoEncodeAccelerator); | 162 DISALLOW_COPY_AND_ASSIGN(MediaFoundationVideoEncodeAccelerator); |
| 159 }; | 163 }; |
| 160 | 164 |
| 161 } // namespace media | 165 } // namespace media |
| 162 | 166 |
| 163 #endif // MEDIA_GPU_MEDIA_FOUNDATION_VIDEO_ENCODE_ACCELERATOR_WIN_H_ | 167 #endif // MEDIA_GPU_MEDIA_FOUNDATION_VIDEO_ENCODE_ACCELERATOR_WIN_H_ |
| OLD | NEW |