91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 57KB
    文件類型: .zip
    金幣: 2
    下載: 0 次
    發布日期: 2021-05-29
  • 語言: 其他
  • 標簽: RTP??

資源簡介

基于S5PV210芯片,實時采集攝像頭數據,經過H.264編碼后,通過RTP協議發送,可在電腦端通過VLC播放器實時播放開發板的攝像頭視頻。

資源截圖

代碼片段和文件信息

#include?
#include?
#include?
#include?
#include??????????????/*?getopt_long()?*/
#include???????????????/*?low-level?i/o?*/
#include?
#include?
#include?
#include?
#include?
#include?
#include?
#include???????????/*?for?videodev2.h?*/
#include?
#include?“camera.h“
#include?“videodev2_samsung.h“

void?Camera::DecodeYUV420SP(unsigned?int*?rgbBuf?unsigned?char*?yuv420sp?int?width?int?height)?{
????int?frameSize?=?width?*?height;

????int?i?=?0?y?=?0;
????int?uvp?=?0?u?=?0?v?=?0;
????int?y1192?=?0?r?=?0?g?=?0?b?=?0;
????unsigned?int?xrgb8888;
????int?xrgb8888Index?=?0;

????for?(int?j?=?0?yp?=?0;?j?????????uvp?=?frameSize?+?(j?>>?1)?*?width;
????????u?=?0;
????????v?=?0;
????????for?(i?=?0;?i?????????????y?=?(0xff?&?((int)?yuv420sp[yp]))?-?16;
????????????if?(y?????????????if?((i?&?1)?==?0)?{
????????????????v?=?(0xff?&?yuv420sp[uvp++])?-?128;
????????????????u?=?(0xff?&?yuv420sp[uvp++])?-?128;
????????????}

????????????y1192?=?1192?*?y;
r?=?(y1192?+?1634?*?u);
g?=?(y1192?-?833?*?u?-?400?*?v);
b?=?(y1192?+?2066?*?v);

????????????if?(r??262143)?r?=?262143;
????????????if?(g??262143)?g?=?262143;
????????????if?(b??262143)?b?=?262143;


????????????r?=?(unsigned?char)(r?>>?10);
????????????g?=?(unsigned?char)(g?>>?10);
????????????b?=?(unsigned?char)(b?>>?10);

????????????xrgb8888?=?(unsigned?int)((r?<????????????rgbBuf[xrgb8888Index++]?=?xrgb8888;
????????}
????}
}

Camera::Camera(char?*DEV_NAME?int?w?int?h)
{
????memcpy(dev_nameDEV_NAMEstrlen(DEV_NAME));
????io?=?IO_METHOD_MMAP;//IO_METHOD_READ;//IO_METHOD_MMAP;
????cap_image_size=0;
????width=w;
????height=h;
}

Camera::~Camera(){

}

unsigned?int?Camera::getImageSize(){
????return?cap_image_size;
}

void?Camera::CloseDevice()?{
????stop_capturing();
????uninit_device();
????close_device();
}

void?Camera::errno_exit(const?char?*?s)?{
????fprintf(stderr?“%s?error?%d?%s\n“?s?errno?strerror(errno));
????exit(EXIT_FAILURE);
}
int?Camera::xioctl(int?fd?int?request?void?*?arg)?{
????int?r;
????do
????????r?=?ioctl(fd?request?arg);
????while?(-1?==?r?&&?EINTR?==?errno);
????return?r;
}

int?Camera::read_frame(unsigned?char?*image)?{
????struct?v4l2_buffer?buf;

????//CLEAR?(buf);
????buf.type?=?V4L2_BUF_TYPE_VIDEO_CAPTURE;
????buf.memory?=?V4L2_MEMORY_MMAP;
????if?(-1?==?xioctl(fd?VIDIOC_DQBUF?&buf))?{
????????switch?(errno)?{
????????case?EAGAIN:
????????????return?0;
????????case?EIO:
????????????/*?Could?ignore?EIO?see?spec.?*/
????????????/*?fall?through?*/
????????default:
????????????errno_exit(“VIDIOC_DQBUF“);
????????}
????}
????assert(buf.index?????memcpy(imagebuffers[buf.index].startcap_image_size);
????if?(-1?==?xioctl(fd

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件?????????101??2016-01-18?16:38??player.sdp
?????目錄???????????0??2016-01-19?11:44??RTP\
?????文件????????6472??2016-01-15?13:24??RTP\.cproject
?????文件?????????831??2016-01-15?13:24??RTP\.project
?????目錄???????????0??2016-01-15?13:24??RTP\.settings\
?????文件????????1096??2016-01-15?13:24??RTP\.settings\language.settings.xml
?????文件????????9702??2016-01-05?10:44??RTP\camera.cpp
?????文件????????1355??2016-01-05?10:30??RTP\camera.h
?????文件????????8928??2016-01-19?11:44??RTP\camera.o
?????文件????????2533??2016-01-19?10:42??RTP\h264.h
?????文件????????1986??2016-01-18?16:28??RTP\main.cpp
?????文件????????4512??2016-01-19?11:44??RTP\main.o
?????文件?????????709??2016-01-18?14:41??RTP\Makefile
?????文件????????4644??2016-01-18?16:15??RTP\mfc.cpp
?????文件?????????702??2016-01-05?10:16??RTP\mfc.h
?????文件????????3644??2016-01-19?11:44??RTP\mfc.o
?????文件???????18495??2015-12-04?11:47??RTP\mfc_interface.h
?????文件??????????92??2016-01-15?14:00??RTP\rtpRecv.cpp
?????文件????????4860??2016-01-19?11:41??RTP\rtpSend.cpp
?????文件????????3764??2016-01-19?11:44??RTP\rtpSend.o
?????文件???????29732??2016-01-19?11:44??RTP\rtp_vlc
?????文件???????16207??2015-12-04?11:45??RTP\SsbSipMfcApi.h
?????文件???????26275??2016-01-05?10:49??RTP\SsbSipMfcEncAPI.c
?????文件????????9252??2016-01-19?11:44??RTP\SsbSipMfcEncAPI.o
?????文件???????21041??2012-06-13?15:37??RTP\videodev2_samsung.h

評論

共有 條評論