0017-chromecast-use-vt-encoder-from-avcodec.patch 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. From 37825bca4dc6e64e7f919e1cdf8654a352d7a69a Mon Sep 17 00:00:00 2001
  2. From: Thomas Guillem <thomas@gllm.fr>
  3. Date: Tue, 27 Mar 2018 16:52:35 +0200
  4. Subject: [PATCH 17/26] chromecast: use vt encoder from avcodec
  5. ---
  6. modules/stream_out/chromecast/cast.cpp | 13 +++++++++++++
  7. 1 file changed, 13 insertions(+)
  8. diff --git a/modules/stream_out/chromecast/cast.cpp b/modules/stream_out/chromecast/cast.cpp
  9. index 5d2aefc139..ab40a04c66 100644
  10. --- a/modules/stream_out/chromecast/cast.cpp
  11. +++ b/modules/stream_out/chromecast/cast.cpp
  12. @@ -950,12 +950,25 @@ static std::string GetVencX264Option( sout_stream_t * /* p_stream */,
  13. return ssout.str();
  14. }
  15. +#ifdef __APPLE__
  16. +static std::string GetVencAvcodecVTOption( sout_stream_t * /* p_stream */,
  17. + const video_format_t * p_vid,
  18. + int i_quality )
  19. +{
  20. + std::stringstream ssout;
  21. + ssout << "venc=avcodec{codec=h264_videotoolbox,options{realtime=1}}";
  22. + return ssout.str();
  23. +}
  24. +#endif
  25. static struct
  26. {
  27. vlc_fourcc_t fcc;
  28. std::string (*get_opt)( sout_stream_t *, const video_format_t *, int);
  29. } venc_opt_list[] = {
  30. +#ifdef __APPLE__
  31. + { .fcc = VLC_CODEC_H264, .get_opt = GetVencAvcodecVTOption },
  32. +#endif
  33. { .fcc = VLC_CODEC_H264, .get_opt = GetVencX264Option },
  34. { .fcc = VLC_CODEC_VP8, .get_opt = GetVencVPXOption },
  35. { .fcc = VLC_CODEC_H264, .get_opt = NULL },
  36. --
  37. 2.20.1