ppb_video_encoder_api.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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
  3. // found in the LICENSE file.
  4. #ifndef PPAPI_THUNK_PPB_VIDEO_ENCODER_API_H_
  5. #define PPAPI_THUNK_PPB_VIDEO_ENCODER_API_H_
  6. #include <stdint.h>
  7. #include "ppapi/c/pp_codecs.h"
  8. #include "ppapi/c/ppb_video_encoder.h"
  9. #include "ppapi/thunk/ppapi_thunk_export.h"
  10. namespace ppapi {
  11. class TrackedCallback;
  12. namespace thunk {
  13. class PPAPI_THUNK_EXPORT PPB_VideoEncoder_API {
  14. public:
  15. virtual ~PPB_VideoEncoder_API() {}
  16. virtual int32_t GetSupportedProfiles(
  17. const PP_ArrayOutput& output,
  18. const scoped_refptr<TrackedCallback>& callback) = 0;
  19. virtual int32_t GetSupportedProfiles0_1(
  20. const PP_ArrayOutput& output,
  21. const scoped_refptr<TrackedCallback>& callback) = 0;
  22. virtual int32_t Initialize(
  23. PP_VideoFrame_Format input_format,
  24. const PP_Size* input_visible_size,
  25. PP_VideoProfile output_profile,
  26. uint32_t initial_bitrate,
  27. PP_HardwareAcceleration acceleration,
  28. const scoped_refptr<TrackedCallback>& callback) = 0;
  29. virtual int32_t GetFramesRequired() = 0;
  30. virtual int32_t GetFrameCodedSize(PP_Size* size) = 0;
  31. virtual int32_t GetVideoFrame(
  32. PP_Resource* video_frame,
  33. const scoped_refptr<TrackedCallback>& callback) = 0;
  34. virtual int32_t Encode(PP_Resource video_frame,
  35. PP_Bool force_keyframe,
  36. const scoped_refptr<TrackedCallback>& callback) = 0;
  37. virtual int32_t GetBitstreamBuffer(
  38. PP_BitstreamBuffer* bitstream_buffer,
  39. const scoped_refptr<TrackedCallback>& callback) = 0;
  40. virtual void RecycleBitstreamBuffer(
  41. const PP_BitstreamBuffer* bitstream_buffer) = 0;
  42. virtual void RequestEncodingParametersChange(uint32_t bitrate,
  43. uint32_t framerate) = 0;
  44. virtual void Close() = 0;
  45. };
  46. } // namespace thunk
  47. } // namespace ppapi
  48. #endif // PPAPI_THUNK_PPB_VIDEO_ENCODER_API_H_