Skip to content

Commit

Permalink
more tries with raw
Browse files Browse the repository at this point in the history
  • Loading branch information
mpromonet committed Sep 25, 2022
1 parent 4c140e2 commit 737c4f8
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 10 deletions.
21 changes: 13 additions & 8 deletions inc/BaseServerMediaSubsession.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,19 @@ class BaseServerMediaSubsession
std::string rtpFormat;
switch(format)
{
case V4L2_PIX_FMT_HEVC : rtpFormat = "video/H265"; break;
case V4L2_PIX_FMT_H264 : rtpFormat = "video/H264"; break;
case V4L2_PIX_FMT_MJPEG: rtpFormat = "video/JPEG"; break;
case V4L2_PIX_FMT_JPEG : rtpFormat = "video/JPEG"; break;
case V4L2_PIX_FMT_VP8 : rtpFormat = "video/VP8" ; break;
case V4L2_PIX_FMT_VP9 : rtpFormat = "video/VP9" ; break;
case V4L2_PIX_FMT_YUYV : rtpFormat = "video/RAW" ; break;
case V4L2_PIX_FMT_UYVY : rtpFormat = "video/RAW" ; break;
case V4L2_PIX_FMT_HEVC : rtpFormat = "video/H265"; break;
case V4L2_PIX_FMT_H264 : rtpFormat = "video/H264"; break;
case V4L2_PIX_FMT_MJPEG : rtpFormat = "video/JPEG"; break;
case V4L2_PIX_FMT_JPEG : rtpFormat = "video/JPEG"; break;
case V4L2_PIX_FMT_VP8 : rtpFormat = "video/VP8" ; break;
case V4L2_PIX_FMT_VP9 : rtpFormat = "video/VP9" ; break;
case V4L2_PIX_FMT_YUV444: rtpFormat = "video/RAW" ; break;
case V4L2_PIX_FMT_UYVY : rtpFormat = "video/RAW" ; break;
case V4L2_PIX_FMT_NV12 : rtpFormat = "video/RAW" ; break;
case V4L2_PIX_FMT_BGR24 : rtpFormat = "video/RAW" ; break;
case V4L2_PIX_FMT_BGR32 : rtpFormat = "video/RAW" ; break;
case V4L2_PIX_FMT_RGB24 : rtpFormat = "video/RAW" ; break;
case V4L2_PIX_FMT_RGB32 : rtpFormat = "video/RAW" ; break;
}

return rtpFormat;
Expand Down
8 changes: 6 additions & 2 deletions src/ServerMediaSubsession.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,12 @@ RTPSink* BaseServerMediaSubsession::createSink(UsageEnvironment& env, Groupsock
DeviceInterface* device = source->getDevice();
switch (device->getVideoFormat()) {
case V4L2_PIX_FMT_YUV444: sampling = "YCbCr-4:4:4"; break;
case V4L2_PIX_FMT_YUYV: sampling = "YCbCr-4:2:2"; break;
case V4L2_PIX_FMT_UYVY: sampling = "YCbCr-4:2:2"; break;
case V4L2_PIX_FMT_UYVY : sampling = "YCbCr-4:2:2"; break;
case V4L2_PIX_FMT_NV12 : sampling = "YCbCr-4:2:0"; break;
case V4L2_PIX_FMT_RGB24 : sampling = "RGB" ; break;
case V4L2_PIX_FMT_RGB32 : sampling = "RGBA" ; break;
case V4L2_PIX_FMT_BGR24 : sampling = "BGR" ; break;
case V4L2_PIX_FMT_BGR32 : sampling = "BGRA" ; break;
}
videoSink = RawVideoRTPSink::createNew(env, rtpGroupsock, rtpPayloadTypeIfDynamic, device->getWidth(), device->getHeight(), 8, sampling.c_str(),"BT709-2");
}
Expand Down

0 comments on commit 737c4f8

Please sign in to comment.