diff --git a/src/h264grabber/h264grabber/h264grabber.c b/src/h264grabber/h264grabber/h264grabber.c index c7ff175..68b5f2b 100644 --- a/src/h264grabber/h264grabber/h264grabber.c +++ b/src/h264grabber/h264grabber/h264grabber.c @@ -248,6 +248,36 @@ unsigned char SPS4_3_1920X1080_TI[] = {0x00, 0x00, 0x00, 0x01, 0x67, 0x64, 0x00, 0xAC, 0x2C, 0xA8, 0x07, 0x80, 0x22, 0x5E, 0x59, 0xA8, 0x08, 0x08, 0x0A, 0x00, 0x00, 0x03, 0x03, 0xE8, 0x00, 0x00, 0x9C, 0x41, 0x08}; +unsigned char SPS5_1920X1080[] = {0x00, 0x00, 0x00, 0x01, 0x42, 0x01, 0x01, 0x01, + 0x60, 0x00, 0x00, 0x03, 0x00, 0x00, 0x03, 0x00, + 0x00, 0x03, 0x00, 0x00, 0x03, 0x00, 0x7B, 0xA0, + 0x03, 0xC0, 0x80, 0x10, 0xE7, 0xF9, 0x6B, 0xB9, + 0x12, 0x20, 0xB2, 0xFC, 0xF3, 0xCF, 0x3C, 0xF3, + 0xCF, 0x3C, 0xF3, 0xCF, 0x3C, 0xF3, 0xCF, 0x3C, + 0xF3, 0xCB, 0x73, 0x70, 0x10, 0x10, 0x10, 0x08}; +unsigned char SPS5_1920X1080_TI[] = {0x00, 0x00, 0x00, 0x01, 0x42, 0x01, 0x01, 0x01, + 0x60, 0x00, 0x00, 0x03, 0x00, 0x00, 0x03, 0x00, + 0x00, 0x03, 0x00, 0x00, 0x03, 0x00, 0x7B, 0xA0, + 0x03, 0xC0, 0x80, 0x10, 0xE7, 0xF9, 0x6B, 0xB9, + 0x12, 0x20, 0xB2, 0xFC, 0xF3, 0xCF, 0x3C, 0xF3, + 0xCF, 0x3C, 0xF3, 0xCF, 0x3C, 0xF3, 0xCF, 0x3C, + 0xF3, 0xCB, 0x73, 0x70, 0x10, 0x10, 0x10, 0x40, + 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x05, 0x02}; +unsigned char SPS5_2_1920X1080[] = {0x00, 0x00, 0x00, 0x01, 0x42, 0x01, 0x01, 0x01, + 0x60, 0x00, 0x00, 0x03, 0x00, 0x00, 0x03, 0x00, + 0x00, 0x03, 0x00, 0x00, 0x03, 0x00, 0xBA, 0xA0, + 0x03, 0xC0, 0x80, 0x10, 0xE7, 0xF9, 0x6B, 0xB9, + 0x12, 0x20, 0xB2, 0xFC, 0xF3, 0xCF, 0x3C, 0xF3, + 0xCF, 0x3C, 0xF3, 0xCF, 0x3C, 0xF3, 0xCF, 0x3C, + 0xF3, 0xCB, 0x73, 0x70, 0x10, 0x10, 0x10, 0x08}; +unsigned char SPS5_2_1920X1080_TI[] = {0x00, 0x00, 0x00, 0x01, 0x42, 0x01, 0x01, 0x01, + 0x60, 0x00, 0x00, 0x03, 0x00, 0x00, 0x03, 0x00, + 0x00, 0x03, 0x00, 0x00, 0x03, 0x00, 0xBA, 0xA0, + 0x03, 0xC0, 0x80, 0x10, 0xE7, 0xF9, 0x6B, 0xB9, + 0x12, 0x20, 0xB2, 0xFC, 0xF3, 0xCF, 0x3C, 0xF3, + 0xCF, 0x3C, 0xF3, 0xCF, 0x3C, 0xF3, 0xCF, 0x3C, + 0xF3, 0xCB, 0x73, 0x70, 0x10, 0x10, 0x10, 0x40, + 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x05, 0x02}; unsigned char VPS5_1920X1080[] = {0x00, 0x00, 0x00, 0x01, 0x40, 0x01, 0x0C, 0x01, 0xFF, 0xFF, 0x01, 0x60, 0x00, 0x00, 0x03, 0x00, 0x00, 0x03, 0x00, 0x00, 0x03, 0x00, 0x00, 0x03, @@ -993,6 +1023,10 @@ int main(int argc, char **argv) { fwrite(SPS4_2304X1296_TI, 1, sizeof(SPS4_2304X1296_TI), fOut); } else if (stream_type.sps_type_high == 0x0203) { fwrite(SPS4_2_2304X1296_TI, 1, sizeof(SPS4_2_2304X1296_TI), fOut); + } else if (stream_type.vps_type_high & 0x0102) { + fwrite(SPS5_1920X1080_TI, 1, sizeof(SPS5_1920X1080_TI), fOut); + } else if (stream_type.vps_type_high & 0x0202) { + fwrite(SPS5_2_1920X1080_TI, 1, sizeof(SPS5_2_1920X1080_TI), fOut); } else { if (buf_idx_start + frame_len > addr + buf_size) { fwrite(buf_idx_start, 1, addr + buf_size - buf_idx_start, fOut); diff --git a/src/rRTSPServer/src/rRTSPServer.cpp b/src/rRTSPServer/src/rRTSPServer.cpp index 1c7ffa2..bee9848 100644 --- a/src/rRTSPServer/src/rRTSPServer.cpp +++ b/src/rRTSPServer/src/rRTSPServer.cpp @@ -123,6 +123,36 @@ unsigned char SPS4_3_1920X1080_TI[] = {0x00, 0x00, 0x00, 0x01, 0x67, 0x64, 0x00, 0xAC, 0x2C, 0xA8, 0x07, 0x80, 0x22, 0x5E, 0x59, 0xA8, 0x08, 0x08, 0x0A, 0x00, 0x00, 0x03, 0x03, 0xE8, 0x00, 0x00, 0x9C, 0x41, 0x08}; +unsigned char SPS5_1920X1080[] = {0x00, 0x00, 0x00, 0x01, 0x42, 0x01, 0x01, 0x01, + 0x60, 0x00, 0x00, 0x03, 0x00, 0x00, 0x03, 0x00, + 0x00, 0x03, 0x00, 0x00, 0x03, 0x00, 0x7B, 0xA0, + 0x03, 0xC0, 0x80, 0x10, 0xE7, 0xF9, 0x6B, 0xB9, + 0x12, 0x20, 0xB2, 0xFC, 0xF3, 0xCF, 0x3C, 0xF3, + 0xCF, 0x3C, 0xF3, 0xCF, 0x3C, 0xF3, 0xCF, 0x3C, + 0xF3, 0xCB, 0x73, 0x70, 0x10, 0x10, 0x10, 0x08}; +unsigned char SPS5_1920X1080_TI[] = {0x00, 0x00, 0x00, 0x01, 0x42, 0x01, 0x01, 0x01, + 0x60, 0x00, 0x00, 0x03, 0x00, 0x00, 0x03, 0x00, + 0x00, 0x03, 0x00, 0x00, 0x03, 0x00, 0x7B, 0xA0, + 0x03, 0xC0, 0x80, 0x10, 0xE7, 0xF9, 0x6B, 0xB9, + 0x12, 0x20, 0xB2, 0xFC, 0xF3, 0xCF, 0x3C, 0xF3, + 0xCF, 0x3C, 0xF3, 0xCF, 0x3C, 0xF3, 0xCF, 0x3C, + 0xF3, 0xCB, 0x73, 0x70, 0x10, 0x10, 0x10, 0x40, + 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x05, 0x02}; +unsigned char SPS5_2_1920X1080[] = {0x00, 0x00, 0x00, 0x01, 0x42, 0x01, 0x01, 0x01, + 0x60, 0x00, 0x00, 0x03, 0x00, 0x00, 0x03, 0x00, + 0x00, 0x03, 0x00, 0x00, 0x03, 0x00, 0xBA, 0xA0, + 0x03, 0xC0, 0x80, 0x10, 0xE7, 0xF9, 0x6B, 0xB9, + 0x12, 0x20, 0xB2, 0xFC, 0xF3, 0xCF, 0x3C, 0xF3, + 0xCF, 0x3C, 0xF3, 0xCF, 0x3C, 0xF3, 0xCF, 0x3C, + 0xF3, 0xCB, 0x73, 0x70, 0x10, 0x10, 0x10, 0x08}; +unsigned char SPS5_2_1920X1080_TI[] = {0x00, 0x00, 0x00, 0x01, 0x42, 0x01, 0x01, 0x01, + 0x60, 0x00, 0x00, 0x03, 0x00, 0x00, 0x03, 0x00, + 0x00, 0x03, 0x00, 0x00, 0x03, 0x00, 0xBA, 0xA0, + 0x03, 0xC0, 0x80, 0x10, 0xE7, 0xF9, 0x6B, 0xB9, + 0x12, 0x20, 0xB2, 0xFC, 0xF3, 0xCF, 0x3C, 0xF3, + 0xCF, 0x3C, 0xF3, 0xCF, 0x3C, 0xF3, 0xCF, 0x3C, + 0xF3, 0xCB, 0x73, 0x70, 0x10, 0x10, 0x10, 0x40, + 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x05, 0x02}; unsigned char VPS5_1920X1080[] = {0x00, 0x00, 0x00, 0x01, 0x40, 0x01, 0x0C, 0x01, 0xFF, 0xFF, 0x01, 0x60, 0x00, 0x00, 0x03, 0x00, 0x00, 0x03, 0x00, 0x00, 0x03, 0x00, 0x00, 0x03, @@ -708,6 +738,12 @@ void *capture(void *ptr) } else if (stream_type.sps_type_high == 0x0203) { frame_len = sizeof(SPS4_2_2304X1296_TI); s2cb_memcpy(cb_current, SPS4_2_2304X1296_TI, sizeof(SPS4_2_2304X1296_TI)); + } else if (stream_type.vps_type_high & 0x0102) { + frame_len = sizeof(SPS5_1920X1080_TI); + s2cb_memcpy(cb_current, SPS5_1920X1080_TI, sizeof(SPS5_1920X1080_TI)); + } else if (stream_type.vps_type_high & 0x0202) { + frame_len = sizeof(SPS5_2_1920X1080_TI); + s2cb_memcpy(cb_current, SPS5_2_1920X1080_TI, sizeof(SPS5_2_1920X1080_TI)); } else { // don't change frame_len cb2cb_memcpy(cb_current, &input_buffer, frame_len);