obs-x264.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /******************************************************************************
  2. Copyright (C) 2013 by Hugh Bailey <[email protected]>
  3. This program is free software: you can redistribute it and/or modify
  4. it under the terms of the GNU General Public License as published by
  5. the Free Software Foundation, either version 2 of the License, or
  6. (at your option) any later version.
  7. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. GNU General Public License for more details.
  11. You should have received a copy of the GNU General Public License
  12. along with this program. If not, see <http://www.gnu.org/licenses/>.
  13. ******************************************************************************/
  14. #pragma once
  15. #include <util/c99defs.h>
  16. #include <obs.h>
  17. #include <x264.h>
  18. struct obs_x264 {
  19. obs_encoder_t encoder;
  20. x264_param_t params;
  21. x264_t *context;
  22. x264_picture_t pic_out;
  23. };
  24. EXPORT const char *obs_x264_getname(const char *locale);
  25. EXPORT struct obs_x264 *obs_x264_create(obs_data_t settings,
  26. obs_encoder_t encoder);
  27. EXPORT void obs_x264_destroy(struct obs_x264 *data);
  28. EXPORT void obs_x264_update(struct obs_x264 *data, obs_data_t settings);
  29. EXPORT void obs_x264_reset(struct obs_x264 *data);
  30. EXPORT int obs_x264_encode(struct obs_x264 *data,
  31. struct encoder_packet **packets);
  32. EXPORT int obs_x264_getheader(struct obs_x264 *data,
  33. struct encoder_packet **packets);
  34. EXPORT void obs_x264_setbitrate(struct obs_x264 *data, uint32_t bitrate,
  35. uint32_t buffersize);
  36. EXPORT void obs_x264_request_keyframe(struct obs_x264 *data);