Fixing the problem related to FrameSubscriber
This commit is contained in:
parent
a2b0e30714
commit
91c96559fa
3 changed files with 62 additions and 13 deletions
|
@ -14,26 +14,43 @@ namespace atom {
|
|||
|
||||
namespace api {
|
||||
|
||||
class FrameSubscriber : public content::RenderWidgetHostViewFrameSubscriber {
|
||||
class FrameSubscriber {
|
||||
public:
|
||||
using FrameCaptureCallback = base::Callback<void(v8::Local<v8::Value>)>;
|
||||
|
||||
// Inner class that is the actual subscriber sent to chromium
|
||||
class Subscriber :
|
||||
public content::RenderWidgetHostViewFrameSubscriber {
|
||||
public:
|
||||
explicit Subscriber(FrameSubscriber* frame_subscriber);
|
||||
|
||||
bool ShouldCaptureFrame(const gfx::Rect& damage_rect,
|
||||
base::TimeTicks present_time,
|
||||
scoped_refptr<media::VideoFrame>* storage,
|
||||
DeliverFrameCallback* callback) override;
|
||||
|
||||
~Subscriber();
|
||||
private:
|
||||
FrameSubscriber* frame_subscriber_;
|
||||
};
|
||||
|
||||
FrameSubscriber(v8::Isolate* isolate,
|
||||
const gfx::Size& size,
|
||||
const FrameCaptureCallback& callback);
|
||||
|
||||
bool ShouldCaptureFrame(const gfx::Rect& damage_rect,
|
||||
base::TimeTicks present_time,
|
||||
scoped_refptr<media::VideoFrame>* storage,
|
||||
DeliverFrameCallback* callback) override;
|
||||
Subscriber* GetSubscriber();
|
||||
|
||||
private:
|
||||
void OnFrameDelivered(
|
||||
scoped_refptr<media::VideoFrame> frame, base::TimeTicks, bool);
|
||||
|
||||
bool RequestDestruct();
|
||||
|
||||
v8::Isolate* isolate_;
|
||||
gfx::Size size_;
|
||||
FrameCaptureCallback callback_;
|
||||
Subscriber* subscriber_;
|
||||
int pending_frames;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(FrameSubscriber);
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue