Originally committed as revision 5538 to svn://svn.ffmpeg.org/ffmpeg/trunk
int width, height;
int video_fd, frame_size;
int ret, frame_rate, frame_rate_base;
int width, height;
int video_fd, frame_size;
int ret, frame_rate, frame_rate_base;
+ int desired_palette, desired_depth;
struct video_tuner tuner;
struct video_audio audio;
struct video_picture pict;
struct video_tuner tuner;
struct video_audio audio;
struct video_picture pict;
- if (st->codec->pix_fmt == PIX_FMT_YUV420P) {
+ desired_depth = -1;
+ if (ap->pix_fmt == PIX_FMT_YUV420P) {
desired_palette = VIDEO_PALETTE_YUV420P;
desired_palette = VIDEO_PALETTE_YUV420P;
- } else if (st->codec->pix_fmt == PIX_FMT_YUV422) {
+ desired_depth = 12;
+ } else if (ap->pix_fmt == PIX_FMT_YUV422) {
desired_palette = VIDEO_PALETTE_YUV422;
desired_palette = VIDEO_PALETTE_YUV422;
- } else if (st->codec->pix_fmt == PIX_FMT_BGR24) {
+ desired_depth = 16;
+ } else if (ap->pix_fmt == PIX_FMT_BGR24) {
desired_palette = VIDEO_PALETTE_RGB24;
desired_palette = VIDEO_PALETTE_RGB24;
#endif
/* try to choose a suitable video format */
pict.palette = desired_palette;
#endif
/* try to choose a suitable video format */
pict.palette = desired_palette;
+ pict.depth= desired_depth;
if (desired_palette == -1 || (ret = ioctl(video_fd, VIDIOCSPICT, &pict)) < 0) {
pict.palette=VIDEO_PALETTE_YUV420P;
if (desired_palette == -1 || (ret = ioctl(video_fd, VIDIOCSPICT, &pict)) < 0) {
pict.palette=VIDEO_PALETTE_YUV420P;
ret = ioctl(video_fd, VIDIOCSPICT, &pict);
if (ret < 0) {
pict.palette=VIDEO_PALETTE_YUV422;
ret = ioctl(video_fd, VIDIOCSPICT, &pict);
if (ret < 0) {
pict.palette=VIDEO_PALETTE_YUV422;
ret = ioctl(video_fd, VIDIOCSPICT, &pict);
if (ret < 0) {
pict.palette=VIDEO_PALETTE_RGB24;
ret = ioctl(video_fd, VIDIOCSPICT, &pict);
if (ret < 0) {
pict.palette=VIDEO_PALETTE_RGB24;
ret = ioctl(video_fd, VIDIOCSPICT, &pict);
if (ret < 0)
goto fail1;
ret = ioctl(video_fd, VIDIOCSPICT, &pict);
if (ret < 0)
goto fail1;