mirror of
https://github.com/mpv-player/mpv
synced 2025-02-19 06:17:00 +00:00
printf --> mp_msg transition in vo_yuv4mpeg
patch by Sebastian Hegler <s_hegler at gmx dot de> git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@13463 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
0ddb43ad39
commit
f38fc23976
@ -788,6 +788,20 @@ static char help_text[]=
|
||||
#define MSGTR_VO_PNM_PGMType "Will write PGM files."
|
||||
#define MSGTR_VO_PNM_PGMYUVType "Will write PGMYUV files."
|
||||
|
||||
// vo_yuv4mpeg.c
|
||||
#define MSGTR_VO_YUV4MPEG_InterlacedHeightDivisibleBy4 "Interlaced mode requires image height to be divisible by 4."
|
||||
#define MSGTR_VO_YUV4MPEG_InterlacedLineBufAllocFail "Unable to allocate line buffer for interlaced mode."
|
||||
#define MSGTR_VO_YUV4MPEG_InterlacedInputNotRGB "Input not RGB, can't separate chrominance by fields!"
|
||||
#define MSGTR_VO_YUV4MPEG_WidthDivisibleBy2 "Image width must be divisible by 2."
|
||||
#define MSGTR_VO_YUV4MPEG_NoMemRGBFrameBuf "Not enough memory to allocate RGB framebuffer."
|
||||
#define MSGTR_VO_YUV4MPEG_OutFileOpenError "Can't get memory or file handle to write \"stream.yuv\"!"
|
||||
#define MSGTR_VO_YUV4MPEG_OutFileWriteError "Error writing image to output!"
|
||||
#define MSGTR_VO_YUV4MPEG_UnknownSubDev "Unknown subdevice: %s"
|
||||
#define MSGTR_VO_YUV4MPEG_InterlacedTFFMode "Using interlaced output mode, top-field first."
|
||||
#define MSGTR_VO_YUV4MPEG_InterlacedBFFMode "Using interlaced output mode, bottom-field first."
|
||||
#define MSGTR_VO_YUV4MPEG_ProgressiveMode "Using (default) progressive frame mode."
|
||||
|
||||
|
||||
// ======================= AO Audio Output drivers ========================
|
||||
|
||||
// libao2
|
||||
|
@ -32,6 +32,9 @@
|
||||
#include "video_out.h"
|
||||
#include "video_out_internal.h"
|
||||
|
||||
#include "mp_msg.h"
|
||||
#include "help_mp.h"
|
||||
|
||||
#include "sub.h"
|
||||
|
||||
#include "fastmemcpy.h"
|
||||
@ -83,24 +86,28 @@ static uint32_t config(uint32_t width, uint32_t height, uint32_t d_width,
|
||||
{
|
||||
if (height % 4)
|
||||
{
|
||||
perror("yuv4mpeg: Interlaced mode requires image height to be divisable by 4");
|
||||
mp_msg(MSGT_VO,MSGL_FATAL,
|
||||
MSGTR_VO_YUV4MPEG_InterlacedHeightDivisibleBy4);
|
||||
return -1;
|
||||
}
|
||||
|
||||
rgb_line_buffer = malloc(image_width * 3);
|
||||
if (!rgb_line_buffer)
|
||||
{
|
||||
perror("yuv4mpeg: Unable to allocate line buffer for interlaced mode");
|
||||
mp_msg(MSGT_VO,MSGL_FATAL,
|
||||
MSGTR_VO_YUV4MPEG_InterlacedLineBufAllocFail);
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (using_format == IMGFMT_YV12)
|
||||
printf("yuv4mpeg: WARNING: Input not RGB; Can't seperate chrominance by fields!\n");
|
||||
mp_msg(MSGT_VO,MSGL_WARN,
|
||||
MSGTR_VO_YUV4MPEG_InterlacedInputNotRGB);
|
||||
}
|
||||
|
||||
if (width % 2)
|
||||
{
|
||||
perror("yuv4mpeg: Image width must be divisable by 2");
|
||||
mp_msg(MSGT_VO,MSGL_FATAL,
|
||||
MSGTR_VO_YUV4MPEG_WidthDivisibleBy2);
|
||||
return -1;
|
||||
}
|
||||
|
||||
@ -110,7 +117,8 @@ static uint32_t config(uint32_t width, uint32_t height, uint32_t d_width,
|
||||
rgb_buffer = malloc(image_width * image_height * 3);
|
||||
if (!rgb_buffer)
|
||||
{
|
||||
perror("yuv4mpeg: Not enough memory to allocate RGB framebuffer");
|
||||
mp_msg(MSGT_VO,MSGL_FATAL,
|
||||
MSGTR_VO_YUV4MPEG_NoMemRGBFrameBuf);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
@ -121,7 +129,8 @@ static uint32_t config(uint32_t width, uint32_t height, uint32_t d_width,
|
||||
yuv_out = fopen("stream.yuv", "wb");
|
||||
if (!yuv_out || image == 0)
|
||||
{
|
||||
perror("yuv4mpeg: Can't get memory or file handle to write stream.yuv");
|
||||
mp_msg(MSGT_VO,MSGL_FATAL,
|
||||
MSGTR_VO_YUV4MPEG_OutFileOpenError);
|
||||
return -1;
|
||||
}
|
||||
image_y = image;
|
||||
@ -220,7 +229,8 @@ static void deinterleave_fields(uint8_t *ptr, const int stride,
|
||||
static void vo_y4m_write(const void *ptr, const size_t num_bytes)
|
||||
{
|
||||
if (fwrite(ptr, 1, num_bytes, yuv_out) != num_bytes)
|
||||
perror("yuv4mpeg: Error writing image to output!");
|
||||
mp_msg(MSGT_VO,MSGL_ERR,
|
||||
MSGTR_VO_YUV4MPEG_OutFileWriteError);
|
||||
}
|
||||
|
||||
static int write_last_frame(void)
|
||||
@ -480,8 +490,9 @@ static uint32_t preinit(const char *arg)
|
||||
/* If both tests failed the argument is invalid */
|
||||
if (arg_unrecognized == 2)
|
||||
{
|
||||
printf("vo_yuv4mpeg: Unknown subdevice: %s\n", arg);
|
||||
return ENOSYS;
|
||||
mp_msg(MSGT_VO,MSGL_FATAL,
|
||||
MSGTR_VO_YUV4MPEG_UnknownSubDev,arg);
|
||||
return -ENOSYS;
|
||||
}
|
||||
}
|
||||
|
||||
@ -489,13 +500,16 @@ static uint32_t preinit(const char *arg)
|
||||
switch (config_interlace)
|
||||
{
|
||||
case Y4M_ILACE_TOP_FIRST:
|
||||
printf("vo_yuv4mpeg: Interlaced output mode, top-field first\n");
|
||||
mp_msg(MSGT_VO,MSGL_STATUS,
|
||||
MSGTR_VO_YUV4MPEG_InterlacedTFFMode);
|
||||
break;
|
||||
case Y4M_ILACE_BOTTOM_FIRST:
|
||||
printf("vo_yuv4mpeg: Interlaced output mode, bottom-field first\n");
|
||||
mp_msg(MSGT_VO,MSGL_STATUS,
|
||||
MSGTR_VO_YUV4MPEG_InterlacedBFFMode);
|
||||
break;
|
||||
default:
|
||||
printf("vo_yuv4mpeg: Using (default) progressive frame mode\n");
|
||||
mp_msg(MSGT_VO,MSGL_STATUS,
|
||||
MSGTR_VO_YUV4MPEG_ProgressiveMode);
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
|
Loading…
Reference in New Issue
Block a user