update video streamtype

Origin commit data
------------------
Branch: master
Commit: 9e9c66c463
Author: redblue-pkt <redblue-pkt@orange.pl>
Date: 2018-10-04 (Thu, 04 Oct 2018)


------------------
No further description and justification available within origin commit message!

------------------
This commit was generated by Migit
This commit is contained in:
redblue-pkt
2018-10-04 01:25:00 +02:00
parent b95524d059
commit ebda3bf041
2 changed files with 34 additions and 47 deletions

View File

@@ -140,15 +140,6 @@ static const char *vid_modes[] = {
"720p50" // VIDEO_STD_AUTO
};
#define VIDEO_STREAMTYPE_MPEG2 0
#define VIDEO_STREAMTYPE_MPEG4_H264 1
#define VIDEO_STREAMTYPE_VC1 3
#define VIDEO_STREAMTYPE_MPEG4_Part2 4
#define VIDEO_STREAMTYPE_VC1_SM 5
#define VIDEO_STREAMTYPE_MPEG1 6
#define VIDEO_STREAMTYPE_H265_HEVC 7
#define VIDEO_STREAMTYPE_AVS 16
ssize_t write_all(int fd, const void *buf, size_t count)
{
int retval;
@@ -760,39 +751,26 @@ void cVideo::SetSyncMode(AVSYNC_TYPE mode)
int cVideo::SetStreamType(VIDEO_FORMAT type)
{
static const char *VF[] = {
"VIDEO_FORMAT_MPEG2",
"VIDEO_FORMAT_MPEG4",
"VIDEO_FORMAT_VC1",
"VIDEO_FORMAT_JPEG",
"VIDEO_FORMAT_GIF",
"VIDEO_FORMAT_PNG"
const char *VF[] = {
"VIDEO_STREAMTYPE_MPEG2",
"VIDEO_STREAMTYPE_MPEG4_H264",
"VIDEO_STREAMTYPE_MPEG4_H263",
"VIDEO_STREAMTYPE_VC1",
"VIDEO_STREAMTYPE_MPEG4_Part2",
"VIDEO_STREAMTYPE_VC1_SM",
"VIDEO_STREAMTYPE_MPEG1",
"VIDEO_STREAMTYPE_DIVX311"
"VIDEO_STREAMTYPE_H265_HEVC",
"VIDEO_STREAMTYPE_AVS"
};
int t;
lt_debug("#%d: %s type=%s\n", devnum, __func__, VF[type]);
switch (type)
{
case VIDEO_FORMAT_MPEG4_H264:
t = VIDEO_STREAMTYPE_MPEG4_H264;
break;
case VIDEO_FORMAT_MPEG4_H265:
t = VIDEO_STREAMTYPE_H265_HEVC;
break;
case VIDEO_FORMAT_AVS:
t = VIDEO_STREAMTYPE_AVS;
break;
case VIDEO_FORMAT_VC1:
t = VIDEO_STREAMTYPE_VC1;
break;
case VIDEO_FORMAT_MPEG2:
default:
t = VIDEO_STREAMTYPE_MPEG2;
break;
}
lt_info("%s - type=%s\n", __FUNCTION__, VF[type]);
if (ioctl( fd, VIDEO_SET_STREAMTYPE, type) < 0)
perror("VIDEO_SET_STREAMTYPE");
StreamType = type;
if (ioctl(fd, VIDEO_SET_STREAMTYPE, t) < 0)
lt_info("%s VIDEO_SET_STREAMTYPE(%d) failed: %m\n", __func__, t);
return 0;
}

View File

@@ -33,14 +33,23 @@ typedef enum {
} COLOR_FORMAT;
typedef enum {
VIDEO_FORMAT_MPEG2 = 0,
VIDEO_FORMAT_MPEG4_H264,
VIDEO_FORMAT_VC1,
VIDEO_FORMAT_JPEG,
VIDEO_FORMAT_GIF,
VIDEO_FORMAT_PNG,
VIDEO_FORMAT_MPEG4_H265,
VIDEO_FORMAT_AVS = 16
VIDEO_STREAMTYPE_UNKNOWN = -1,
VIDEO_STREAMTYPE_MPEG2 = 0,
VIDEO_STREAMTYPE_MPEG4_H264 = 1,
VIDEO_STREAMTYPE_H263 = 2,
VIDEO_STREAMTYPE_VC1 = 3,
VIDEO_STREAMTYPE_MPEG4_Part2 = 4,
VIDEO_STREAMTYPE_VC1_SM = 5,
VIDEO_STREAMTYPE_MPEG1 = 6,
VIDEO_STREAMTYPE_MPEG4_H265 = 7,
VIDEO_STREAMTYPE_VB8 = 8,
VIDEO_STREAMTYPE_VB9 = 9,
VIDEO_STREAMTYPE_XVID = 10,
VIDEO_STREAMTYPE_DIVX311 = 13,
VIDEO_STREAMTYPE_DIVX4 = 14,
VIDEO_STREAMTYPE_DIVX5 = 15,
VIDEO_STREAMTYPE_VB6 = 18,
VIDEO_STREAMTYPE_SPARK = 21
} VIDEO_FORMAT;
typedef enum {