Chromium Code Reviews| 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 EXTENSIONS_RENDERER_API_DISPLAY_SOURCE_WIFI_DISPLAY_WIFI_DISPLAY_VIDEO_E NCODER_H_ | 5 #ifndef EXTENSIONS_RENDERER_API_DISPLAY_SOURCE_WIFI_DISPLAY_WIFI_DISPLAY_VIDEO_E NCODER_H_ |
| 6 #define EXTENSIONS_RENDERER_API_DISPLAY_SOURCE_WIFI_DISPLAY_WIFI_DISPLAY_VIDEO_E NCODER_H_ | 6 #define EXTENSIONS_RENDERER_API_DISPLAY_SOURCE_WIFI_DISPLAY_WIFI_DISPLAY_VIDEO_E NCODER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/memory/shared_memory.h" | 10 #include "base/memory/shared_memory.h" |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 71 // A factory method that creates a new encoder instance from the given | 71 // A factory method that creates a new encoder instance from the given |
| 72 // |params|, the encoder instance is returned as an argument of | 72 // |params|, the encoder instance is returned as an argument of |
| 73 // |result_callback| ('nullptr' argument means encoder creation failure). | 73 // |result_callback| ('nullptr' argument means encoder creation failure). |
| 74 static void Create( | 74 static void Create( |
| 75 const InitParameters& params, | 75 const InitParameters& params, |
| 76 const VideoEncoderCallback& encoder_callback); | 76 const VideoEncoderCallback& encoder_callback); |
| 77 | 77 |
| 78 // Encodes the given raw frame. The resulting encoded frame is passed | 78 // Encodes the given raw frame. The resulting encoded frame is passed |
| 79 // as an |encoded_callback|'s argument which is set via 'SetCallbacks' | 79 // as an |encoded_callback|'s argument which is set via 'SetCallbacks' |
| 80 // method. | 80 // method. |
| 81 virtual void InsertRawVideoFrame( | 81 void InsertRawVideoFrame(const scoped_refptr<media::VideoFrame>& video_frame, |
| 82 const scoped_refptr<media::VideoFrame>& video_frame, | 82 base::TimeTicks reference_time); |
| 83 base::TimeTicks reference_time) = 0; | |
| 84 | 83 |
| 85 // Requests the next encoded frame to be an instantaneous decoding refresh | 84 // Requests the next encoded frame to be an instantaneous decoding refresh |
| 86 // (IDR) picture. | 85 // (IDR) picture. |
| 87 virtual void RequestIDRPicture() = 0; | 86 void RequestIDRPicture() { send_idr_ = true; } |
|
Mikhail
2016/04/22 09:28:34
pls. move body to .cc
e_hakkinen
2016/04/22 09:54:50
Done.
| |
| 88 | 87 |
| 89 // Sets callbacks for the obtained encoder instance: | 88 // Sets callbacks for the obtained encoder instance: |
| 90 // |encoded_callback| is invoked to return the next encoded frame | 89 // |encoded_callback| is invoked to return the next encoded frame |
| 91 // |error_callback| is invoked to report a fatal encoder error | 90 // |error_callback| is invoked to report a fatal encoder error |
| 92 void SetCallbacks(const EncodedFrameCallback& encoded_callback, | 91 void SetCallbacks(const EncodedFrameCallback& encoded_callback, |
| 93 const base::Closure& error_callback); | 92 const base::Closure& error_callback); |
| 94 | 93 |
| 95 protected: | 94 protected: |
| 96 friend class base::RefCountedThreadSafe<WiFiDisplayVideoEncoder>; | 95 friend class base::RefCountedThreadSafe<WiFiDisplayVideoEncoder>; |
| 97 WiFiDisplayVideoEncoder(); | 96 WiFiDisplayVideoEncoder( |
|
Mikhail
2016/04/22 09:28:34
explicit
e_hakkinen
2016/04/22 09:54:50
Done.
| |
| 97 const scoped_refptr<base::SingleThreadTaskRunner>& media_task_runner); | |
|
Mikhail
2016/04/22 09:28:34
think we can pass just scoped_refptr<base::SingleT
e_hakkinen
2016/04/22 09:54:50
Done.
| |
| 98 virtual ~WiFiDisplayVideoEncoder(); | 98 virtual ~WiFiDisplayVideoEncoder(); |
| 99 | 99 |
| 100 virtual void InsertFrameOnMediaThread( | |
| 101 scoped_refptr<media::VideoFrame> video_frame, | |
| 102 base::TimeTicks reference_time, | |
| 103 bool send_idr) = 0; | |
| 104 | |
| 100 EncodedFrameCallback encoded_callback_; | 105 EncodedFrameCallback encoded_callback_; |
| 101 base::Closure error_callback_; | 106 base::Closure error_callback_; |
| 107 scoped_refptr<base::SingleThreadTaskRunner> media_task_runner_; | |
| 108 bool send_idr_; | |
| 102 }; | 109 }; |
| 103 | 110 |
| 104 } // namespace extensions | 111 } // namespace extensions |
| 105 | 112 |
| 106 #endif // EXTENSIONS_RENDERER_API_DISPLAY_SOURCE_WIFI_DISPLAY_WIFI_DISPLAY_VIDE O_ENCODER_H_ | 113 #endif // EXTENSIONS_RENDERER_API_DISPLAY_SOURCE_WIFI_DISPLAY_WIFI_DISPLAY_VIDE O_ENCODER_H_ |
| OLD | NEW |