MCPcopy Create free account
hub / github.com/EasyDarwin/EasyPusher / Encoder

Method Encoder

EasyPusher_Win/EasyPusher/EasyEncoder/H264Encoder.cpp:140–160  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

138}
139
140unsigned char* CH264Encoder::Encoder(unsigned char *indata, int inlen, int &outlen, bool &bIsKeyFrame)
141{
142 if (m_bIsworking&&(inlen==m_ncheckyuvsize))
143 {
144 int m_inal=0;
145 memcpy(m_x264_picin->img.plane[0],indata,inlen);
146 outlen=x264_encoder_encode(m_hx264,&m_x264_nal,&m_inal,m_x264_picin,&m_x264_picout);
147 m_x264_picin->i_pts++;
148 }else
149 {
150 outlen=-1;
151 }
152 if (outlen>0)
153 {
154 bIsKeyFrame=m_x264_picout.b_keyframe==1;
155 return m_x264_nal[0].p_payload;
156 }else
157 {
158 return NULL;
159 }
160}
161
162void CH264Encoder::X264_CONFIG_SET(x264_param_t*param,int mode)
163{

Callers 1

DSRealDataManagerMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected