Advertisement
Guest User

Untitled

a guest
Aug 4th, 2014
247
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.41 KB | None | 0 0
  1. diff -r 4af5d016a1cd configure
  2. --- a/configure Fri Jul 11 16:58:14 2014 +0300
  3. +++ b/configure Fri Jul 11 17:15:32 2014 +0300
  4. @@ -245,7 +245,7 @@
  5. if enabled_or_auto libav; then
  6. has_libav=true
  7.  
  8. - if $has_libav && ! check_pkg libavcodec "<=55.0.0"; then
  9. + if $has_libav && ! check_pkg libavcodec "<=56.0.0"; then
  10. has_libav=false
  11. fi
  12.  
  13. @@ -257,7 +257,7 @@
  14. has_libav=false
  15. fi
  16.  
  17. - if $has_libav && ! check_pkg libavformat "<=55.0.0"; then
  18. + if $has_libav && ! check_pkg libavformat "<=56.0.0"; then
  19. has_libav=false
  20. fi
  21.  
  22. diff -r 4af5d016a1cd src/libav.c
  23. --- a/src/libav.c Fri Jul 11 16:58:14 2014 +0300
  24. +++ b/src/libav.c Fri Jul 11 17:15:32 2014 +0300
  25. @@ -50,47 +50,47 @@
  26. /**
  27. * Translate a component type to a libavcodec id
  28. */
  29. -enum CodecID
  30. +enum AVCodecID
  31. streaming_component_type2codec_id(streaming_component_type_t type)
  32. {
  33. - enum CodecID codec_id = CODEC_ID_NONE;
  34. + enum AVCodecID codec_id = AV_CODEC_ID_NONE;
  35.  
  36. switch(type) {
  37. case SCT_H264:
  38. - codec_id = CODEC_ID_H264;
  39. + codec_id = AV_CODEC_ID_H264;
  40. break;
  41. case SCT_MPEG2VIDEO:
  42. - codec_id = CODEC_ID_MPEG2VIDEO;
  43. + codec_id = AV_CODEC_ID_MPEG2VIDEO;
  44. break;
  45. case SCT_VP8:
  46. - codec_id = CODEC_ID_VP8;
  47. + codec_id = AV_CODEC_ID_VP8;
  48. break;
  49. case SCT_AC3:
  50. - codec_id = CODEC_ID_AC3;
  51. + codec_id = AV_CODEC_ID_AC3;
  52. break;
  53. case SCT_EAC3:
  54. - codec_id = CODEC_ID_EAC3;
  55. + codec_id = AV_CODEC_ID_EAC3;
  56. break;
  57. case SCT_AAC:
  58. - codec_id = CODEC_ID_AAC;
  59. + codec_id = AV_CODEC_ID_AAC;
  60. break;
  61. case SCT_MPEG2AUDIO:
  62. - codec_id = CODEC_ID_MP2;
  63. + codec_id = AV_CODEC_ID_MP2;
  64. break;
  65. case SCT_VORBIS:
  66. - codec_id = CODEC_ID_VORBIS;
  67. + codec_id = AV_CODEC_ID_VORBIS;
  68. break;
  69. case SCT_DVBSUB:
  70. - codec_id = CODEC_ID_DVB_SUBTITLE;
  71. + codec_id = AV_CODEC_ID_DVB_SUBTITLE;
  72. break;
  73. case SCT_TEXTSUB:
  74. - codec_id = CODEC_ID_TEXT;
  75. + codec_id = AV_CODEC_ID_TEXT;
  76. break;
  77. case SCT_TELETEXT:
  78. - codec_id = CODEC_ID_DVB_TELETEXT;
  79. + codec_id = AV_CODEC_ID_DVB_TELETEXT;
  80. break;
  81. default:
  82. - codec_id = CODEC_ID_NONE;
  83. + codec_id = AV_CODEC_ID_NONE;
  84. break;
  85. }
  86.  
  87. @@ -102,45 +102,45 @@
  88. * Translate a libavcodec id to a component type
  89. */
  90. streaming_component_type_t
  91. -codec_id2streaming_component_type(enum CodecID id)
  92. +codec_id2streaming_component_type(enum AVCodecID id)
  93. {
  94. - streaming_component_type_t type = CODEC_ID_NONE;
  95. + streaming_component_type_t type = AV_CODEC_ID_NONE;
  96.  
  97. switch(id) {
  98. - case CODEC_ID_H264:
  99. + case AV_CODEC_ID_H264:
  100. type = SCT_H264;
  101. break;
  102. - case CODEC_ID_MPEG2VIDEO:
  103. + case AV_CODEC_ID_MPEG2VIDEO:
  104. type = SCT_MPEG2VIDEO;
  105. break;
  106. - case CODEC_ID_VP8:
  107. + case AV_CODEC_ID_VP8:
  108. type = SCT_VP8;
  109. break;
  110. - case CODEC_ID_AC3:
  111. + case AV_CODEC_ID_AC3:
  112. type = SCT_AC3;
  113. break;
  114. - case CODEC_ID_EAC3:
  115. + case AV_CODEC_ID_EAC3:
  116. type = SCT_EAC3;
  117. break;
  118. - case CODEC_ID_AAC:
  119. + case AV_CODEC_ID_AAC:
  120. type = SCT_AAC;
  121. break;
  122. - case CODEC_ID_MP2:
  123. + case AV_CODEC_ID_MP2:
  124. type = SCT_MPEG2AUDIO;
  125. break;
  126. - case CODEC_ID_VORBIS:
  127. + case AV_CODEC_ID_VORBIS:
  128. type = SCT_VORBIS;
  129. break;
  130. - case CODEC_ID_DVB_SUBTITLE:
  131. + case AV_CODEC_ID_DVB_SUBTITLE:
  132. type = SCT_DVBSUB;
  133. break;
  134. - case CODEC_ID_TEXT:
  135. + case AV_CODEC_ID_TEXT:
  136. type = SCT_TEXTSUB;
  137. break;
  138. - case CODEC_ID_DVB_TELETEXT:
  139. + case AV_CODEC_ID_DVB_TELETEXT:
  140. type = SCT_TELETEXT;
  141. break;
  142. - case CODEC_ID_NONE:
  143. + case AV_CODEC_ID_NONE:
  144. type = SCT_NONE;
  145. break;
  146. default:
  147. diff -r 4af5d016a1cd src/libav.h
  148. --- a/src/libav.h Fri Jul 11 16:58:14 2014 +0300
  149. +++ b/src/libav.h Fri Jul 11 17:15:32 2014 +0300
  150. @@ -23,8 +23,8 @@
  151. #include <libavformat/avformat.h>
  152. #include "tvheadend.h"
  153.  
  154. -enum CodecID streaming_component_type2codec_id(streaming_component_type_t type);
  155. -streaming_component_type_t codec_id2streaming_component_type(enum CodecID id);
  156. +enum AVCodecID streaming_component_type2codec_id(streaming_component_type_t type);
  157. +streaming_component_type_t codec_id2streaming_component_type(enum AVCodecID id);
  158. int libav_is_encoder(AVCodec *codec);
  159. void libav_init(void);
  160.  
  161. diff -r 4af5d016a1cd src/plumbing/transcoding.c
  162. --- a/src/plumbing/transcoding.c Fri Jul 11 16:58:14 2014 +0300
  163. +++ b/src/plumbing/transcoding.c Fri Jul 11 17:15:32 2014 +0300
  164. @@ -108,9 +108,9 @@
  165.  
  166.  
  167.  
  168. -#define WORKING_ENCODER(x) (x == CODEC_ID_H264 || x == CODEC_ID_MPEG2VIDEO || \
  169. - x == CODEC_ID_VP8 || x == CODEC_ID_AAC || \
  170. - x == CODEC_ID_MP2 || x == CODEC_ID_VORBIS)
  171. +#define WORKING_ENCODER(x) (x == AV_CODEC_ID_H264 || x == AV_CODEC_ID_MPEG2VIDEO || \
  172. + x == AV_CODEC_ID_VP8 || x == AV_CODEC_ID_AAC || \
  173. + x == AV_CODEC_ID_MP2 || x == AV_CODEC_ID_VORBIS)
  174.  
  175.  
  176. uint32_t transcoding_enabled = 0;
  177. @@ -121,11 +121,11 @@
  178. static AVCodec *
  179. transcoder_get_decoder(streaming_component_type_t ty)
  180. {
  181. - enum CodecID codec_id;
  182. + enum AVCodecID codec_id;
  183. AVCodec *codec;
  184.  
  185. codec_id = streaming_component_type2codec_id(ty);
  186. - if (codec_id == CODEC_ID_NONE) {
  187. + if (codec_id == AV_CODEC_ID_NONE) {
  188. tvhlog(LOG_ERR, "transcode", "Unsupported input codec %s",
  189. streaming_component_type2txt(ty));
  190. return NULL;
  191. @@ -150,11 +150,11 @@
  192. static AVCodec *
  193. transcoder_get_encoder(streaming_component_type_t ty)
  194. {
  195. - enum CodecID codec_id;
  196. + enum AVCodecID codec_id;
  197. AVCodec *codec;
  198.  
  199. codec_id = streaming_component_type2codec_id(ty);
  200. - if (codec_id == CODEC_ID_NONE) {
  201. + if (codec_id == AV_CODEC_ID_NONE) {
  202. tvhlog(LOG_ERR, "transcode", "Unable to find %s codec",
  203. streaming_component_type2txt(ty));
  204. return NULL;
  205. @@ -214,7 +214,7 @@
  206. icodec = ss->sub_icodec;
  207. //ocodec = ss->sub_ocodec;
  208.  
  209. - if (ictx->codec_id == CODEC_ID_NONE) {
  210. + if (ictx->codec_id == AV_CODEC_ID_NONE) {
  211. ictx->codec_id = icodec->id;
  212.  
  213. if (avcodec_open2(ictx, icodec, NULL) < 0) {
  214. @@ -272,7 +272,7 @@
  215. icodec = as->aud_icodec;
  216. ocodec = as->aud_ocodec;
  217.  
  218. - if (ictx->codec_id == CODEC_ID_NONE) {
  219. + if (ictx->codec_id == AV_CODEC_ID_NONE) {
  220. ictx->codec_id = icodec->id;
  221.  
  222. if (avcodec_open2(ictx, icodec, NULL) < 0) {
  223. @@ -391,7 +391,7 @@
  224. break;
  225. }
  226.  
  227. - if (octx->codec_id == CODEC_ID_NONE) {
  228. + if (octx->codec_id == AV_CODEC_ID_NONE) {
  229. octx->codec_id = ocodec->id;
  230.  
  231. if (avcodec_open2(octx, ocodec, NULL) < 0) {
  232. @@ -478,7 +478,7 @@
  233. buf = out = deint = NULL;
  234. opts = NULL;
  235.  
  236. - if (ictx->codec_id == CODEC_ID_NONE) {
  237. + if (ictx->codec_id == AV_CODEC_ID_NONE) {
  238. ictx->codec_id = icodec->id;
  239.  
  240. if (avcodec_open2(ictx, icodec, NULL) < 0) {
  241. @@ -523,7 +523,7 @@
  242. vs->vid_enc_frame->sample_aspect_ratio.num = vs->vid_dec_frame->sample_aspect_ratio.num;
  243. vs->vid_enc_frame->sample_aspect_ratio.den = vs->vid_dec_frame->sample_aspect_ratio.den;
  244.  
  245. - if(octx->codec_id == CODEC_ID_NONE) {
  246. + if(octx->codec_id == AV_CODEC_ID_NONE) {
  247. // Common settings
  248. octx->width = vs->vid_width ? vs->vid_width : ictx->width;
  249. octx->height = vs->vid_height ? vs->vid_height : ictx->height;
  250. @@ -534,7 +534,7 @@
  251.  
  252. switch (ts->ts_type) {
  253. case SCT_MPEG2VIDEO:
  254. - octx->codec_id = CODEC_ID_MPEG2VIDEO;
  255. + octx->codec_id = AV_CODEC_ID_MPEG2VIDEO;
  256. octx->pix_fmt = PIX_FMT_YUV420P;
  257. octx->flags |= CODEC_FLAG_GLOBAL_HEADER;
  258.  
  259. @@ -547,7 +547,7 @@
  260. break;
  261.  
  262. case SCT_VP8:
  263. - octx->codec_id = CODEC_ID_VP8;
  264. + octx->codec_id = AV_CODEC_ID_VP8;
  265. octx->pix_fmt = PIX_FMT_YUV420P;
  266.  
  267. octx->qmin = 10;
  268. @@ -561,7 +561,7 @@
  269. break;
  270.  
  271. case SCT_H264:
  272. - octx->codec_id = CODEC_ID_H264;
  273. + octx->codec_id = AV_CODEC_ID_H264;
  274. octx->pix_fmt = PIX_FMT_YUV420P;
  275. octx->flags |= CODEC_FLAG_GLOBAL_HEADER;
  276.  
  277. @@ -951,8 +951,8 @@
  278. as->aud_ictx->thread_count = sysconf(_SC_NPROCESSORS_ONLN);
  279. as->aud_octx->thread_count = sysconf(_SC_NPROCESSORS_ONLN);
  280.  
  281. - as->aud_dec_size = AVCODEC_MAX_AUDIO_FRAME_SIZE*2;
  282. - as->aud_enc_size = AVCODEC_MAX_AUDIO_FRAME_SIZE*2;
  283. + as->aud_dec_size = 192000*2;
  284. + as->aud_enc_size = 192000*2;
  285.  
  286. as->aud_dec_sample = av_malloc(as->aud_dec_size + FF_INPUT_BUFFER_PADDING_SIZE);
  287. as->aud_enc_sample = av_malloc(as->aud_enc_size + FF_INPUT_BUFFER_PADDING_SIZE);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement