Re: [FFmpeg-devel] [PATCH v2 01/12] lavc/videotoolboxenc: Use shared pixel buffer pool
on iOS when enter background got Could not get pixel buffer pool. error How about videotoolbox run on background? On Wed, Apr 27, 2016 at 12:00 AM, Richard Kernwrote: > > > On Apr 26, 2016, at 8:14 AM, Carl Eugen Hoyos wrote: > > > > Richard Kern gmail.com> writes: > > > static const enum AVPixelFormat pix_fmts[] = { > AV_PIX_FMT_NV12, > -#if !TARGET_OS_IPHONE > AV_PIX_FMT_YUV420P, > -#endif > AV_PIX_FMT_NONE > >>> > >>> Sorry: How is this related? > >> Using a shared pixel buffer pool also sets up an internal > >> color converter when needed. > > > > And is this generally wanted? > > (I assume so.) > The pool? Probably. Using it reduces memcpy calls in the media server > process. > > I dug into this a little - yuv420p is supported natively (at least on some > devices), so it shouldn’t have been excluded in the first place. > > > > > Carl Eugen > > > > ___ > > ffmpeg-devel mailing list > > ffmpeg-devel@ffmpeg.org > > http://ffmpeg.org/mailman/listinfo/ffmpeg-devel > > ___ > ffmpeg-devel mailing list > ffmpeg-devel@ffmpeg.org > http://ffmpeg.org/mailman/listinfo/ffmpeg-devel > ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH v2 01/12] lavc/videotoolboxenc: Use shared pixel buffer pool
> On Apr 26, 2016, at 8:14 AM, Carl Eugen Hoyoswrote: > > Richard Kern gmail.com> writes: > static const enum AVPixelFormat pix_fmts[] = { AV_PIX_FMT_NV12, -#if !TARGET_OS_IPHONE AV_PIX_FMT_YUV420P, -#endif AV_PIX_FMT_NONE >>> >>> Sorry: How is this related? >> Using a shared pixel buffer pool also sets up an internal >> color converter when needed. > > And is this generally wanted? > (I assume so.) The pool? Probably. Using it reduces memcpy calls in the media server process. I dug into this a little - yuv420p is supported natively (at least on some devices), so it shouldn’t have been excluded in the first place. > > Carl Eugen > > ___ > ffmpeg-devel mailing list > ffmpeg-devel@ffmpeg.org > http://ffmpeg.org/mailman/listinfo/ffmpeg-devel ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH v2 01/12] lavc/videotoolboxenc: Use shared pixel buffer pool
Richard Kern gmail.com> writes: > >> static const enum AVPixelFormat pix_fmts[] = { > >> AV_PIX_FMT_NV12, > >> -#if !TARGET_OS_IPHONE > >> AV_PIX_FMT_YUV420P, > >> -#endif > >> AV_PIX_FMT_NONE > > > > Sorry: How is this related? > Using a shared pixel buffer pool also sets up an internal > color converter when needed. And is this generally wanted? (I assume so.) Carl Eugen ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH v2 01/12] lavc/videotoolboxenc: Use shared pixel buffer pool
> On Apr 23, 2016, at 12:23 PM, Carl Eugen Hoyoswrote: > > Rick Kern gmail.com> writes: > >> +if(!*refPtr) return; > > Is this needed (I don't know)? > If yes, please make it two lines. > >> +CFRelease(*refPtr); >> +*refPtr = NULL; >> +switch (fmt) { >> +case AV_PIX_FMT_NV12: >> +switch (range) { >> +case AVCOL_RANGE_MPEG: >> +*av_pixel_format = >> kCVPixelFormatType_420YpCbCr8BiPlanarVideoRange; >> +break; >> + >> +case AVCOL_RANGE_JPEG: >> +*av_pixel_format = >> kCVPixelFormatType_420YpCbCr8BiPlanarFullRange; >> +break; >> + >> +default: >> +if (range_guessed) *range_guessed = 1; >> +*av_pixel_format = >> kCVPixelFormatType_420YpCbCr8BiPlanarVideoRange; > > You can rearrange this to make the patch smaller (and > the default case easier to read). > Same below. > >> static const enum AVPixelFormat pix_fmts[] = { >> AV_PIX_FMT_NV12, >> -#if !TARGET_OS_IPHONE >> AV_PIX_FMT_YUV420P, >> -#endif >> AV_PIX_FMT_NONE > > Sorry: How is this related? Using a shared pixel buffer pool also sets up an internal color converter when needed. > > Carl Eugen > > ___ > ffmpeg-devel mailing list > ffmpeg-devel@ffmpeg.org > http://ffmpeg.org/mailman/listinfo/ffmpeg-devel ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH v2 01/12] lavc/videotoolboxenc: Use shared pixel buffer pool
Rick Kern gmail.com> writes: > +if(!*refPtr) return; Is this needed (I don't know)? If yes, please make it two lines. > +CFRelease(*refPtr); > +*refPtr = NULL; > +switch (fmt) { > +case AV_PIX_FMT_NV12: > +switch (range) { > +case AVCOL_RANGE_MPEG: > +*av_pixel_format = > kCVPixelFormatType_420YpCbCr8BiPlanarVideoRange; > +break; > + > +case AVCOL_RANGE_JPEG: > +*av_pixel_format = > kCVPixelFormatType_420YpCbCr8BiPlanarFullRange; > +break; > + > +default: > +if (range_guessed) *range_guessed = 1; > +*av_pixel_format = > kCVPixelFormatType_420YpCbCr8BiPlanarVideoRange; You can rearrange this to make the patch smaller (and the default case easier to read). Same below. > static const enum AVPixelFormat pix_fmts[] = { > AV_PIX_FMT_NV12, > -#if !TARGET_OS_IPHONE > AV_PIX_FMT_YUV420P, > -#endif > AV_PIX_FMT_NONE Sorry: How is this related? Carl Eugen ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel