mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-23 07:38:16 +00:00
rtph265pay: Use snake_case variables
Align with rtph264pay
This commit is contained in:
parent
d4268ab2bf
commit
a6d50889af
1 changed files with 32 additions and 32 deletions
|
@ -886,8 +886,8 @@ gst_rtp_h265_pay_payload_nal (GstRTPBasePayload * basepayload,
|
||||||
ret = GST_FLOW_OK;
|
ret = GST_FLOW_OK;
|
||||||
sent_ps = FALSE;
|
sent_ps = FALSE;
|
||||||
for (i = 0; i < paybufs->len; i++) {
|
for (i = 0; i < paybufs->len; i++) {
|
||||||
guint8 nalHeader[2];
|
guint8 nal_header[2];
|
||||||
guint8 nalType;
|
guint8 nal_type;
|
||||||
guint packet_len, payload_len;
|
guint packet_len, payload_len;
|
||||||
GstBuffer *paybuf;
|
GstBuffer *paybuf;
|
||||||
GstBuffer *outbuf;
|
GstBuffer *outbuf;
|
||||||
|
@ -909,29 +909,29 @@ gst_rtp_h265_pay_payload_nal (GstRTPBasePayload * basepayload,
|
||||||
marker = GST_BUFFER_FLAG_IS_SET (paybuf, GST_BUFFER_FLAG_MARKER);
|
marker = GST_BUFFER_FLAG_IS_SET (paybuf, GST_BUFFER_FLAG_MARKER);
|
||||||
|
|
||||||
size = gst_buffer_get_size (paybuf);
|
size = gst_buffer_get_size (paybuf);
|
||||||
gst_buffer_extract (paybuf, 0, nalHeader, 2);
|
gst_buffer_extract (paybuf, 0, nal_header, 2);
|
||||||
nalType = (nalHeader[0] >> 1) & 0x3f;
|
nal_type = (nal_header[0] >> 1) & 0x3f;
|
||||||
|
|
||||||
GST_DEBUG_OBJECT (rtph265pay, "Processing Buffer with NAL TYPE=%d",
|
GST_DEBUG_OBJECT (rtph265pay, "Processing Buffer with NAL TYPE=%d",
|
||||||
nalType);
|
nal_type);
|
||||||
|
|
||||||
send_ps = FALSE;
|
send_ps = FALSE;
|
||||||
|
|
||||||
/* check if we need to emit an VPS/SPS/PPS now */
|
/* check if we need to emit an VPS/SPS/PPS now */
|
||||||
if ((nalType == GST_H265_NAL_SLICE_TRAIL_N)
|
if ((nal_type == GST_H265_NAL_SLICE_TRAIL_N)
|
||||||
|| (nalType == GST_H265_NAL_SLICE_TRAIL_R)
|
|| (nal_type == GST_H265_NAL_SLICE_TRAIL_R)
|
||||||
|| (nalType == GST_H265_NAL_SLICE_TSA_N)
|
|| (nal_type == GST_H265_NAL_SLICE_TSA_N)
|
||||||
|| (nalType == GST_H265_NAL_SLICE_TSA_R)
|
|| (nal_type == GST_H265_NAL_SLICE_TSA_R)
|
||||||
|| (nalType == GST_H265_NAL_SLICE_STSA_N)
|
|| (nal_type == GST_H265_NAL_SLICE_STSA_N)
|
||||||
|| (nalType == GST_H265_NAL_SLICE_STSA_R)
|
|| (nal_type == GST_H265_NAL_SLICE_STSA_R)
|
||||||
|| (nalType == GST_H265_NAL_SLICE_RASL_N)
|
|| (nal_type == GST_H265_NAL_SLICE_RASL_N)
|
||||||
|| (nalType == GST_H265_NAL_SLICE_RASL_R)
|
|| (nal_type == GST_H265_NAL_SLICE_RASL_R)
|
||||||
|| (nalType == GST_H265_NAL_SLICE_BLA_W_LP)
|
|| (nal_type == GST_H265_NAL_SLICE_BLA_W_LP)
|
||||||
|| (nalType == GST_H265_NAL_SLICE_BLA_W_RADL)
|
|| (nal_type == GST_H265_NAL_SLICE_BLA_W_RADL)
|
||||||
|| (nalType == GST_H265_NAL_SLICE_BLA_N_LP)
|
|| (nal_type == GST_H265_NAL_SLICE_BLA_N_LP)
|
||||||
|| (nalType == GST_H265_NAL_SLICE_IDR_W_RADL)
|
|| (nal_type == GST_H265_NAL_SLICE_IDR_W_RADL)
|
||||||
|| (nalType == GST_H265_NAL_SLICE_IDR_N_LP)
|
|| (nal_type == GST_H265_NAL_SLICE_IDR_N_LP)
|
||||||
|| (nalType == GST_H265_NAL_SLICE_CRA_NUT)) {
|
|| (nal_type == GST_H265_NAL_SLICE_CRA_NUT)) {
|
||||||
if (rtph265pay->vps_sps_pps_interval > 0) {
|
if (rtph265pay->vps_sps_pps_interval > 0) {
|
||||||
if (rtph265pay->last_vps_sps_pps != -1) {
|
if (rtph265pay->last_vps_sps_pps != -1) {
|
||||||
guint64 diff;
|
guint64 diff;
|
||||||
|
@ -966,8 +966,8 @@ gst_rtp_h265_pay_payload_nal (GstRTPBasePayload * basepayload,
|
||||||
send_ps = TRUE;
|
send_ps = TRUE;
|
||||||
}
|
}
|
||||||
} else if (rtph265pay->vps_sps_pps_interval == -1
|
} else if (rtph265pay->vps_sps_pps_interval == -1
|
||||||
&& (nalType == GST_H265_NAL_SLICE_IDR_W_RADL
|
&& (nal_type == GST_H265_NAL_SLICE_IDR_W_RADL
|
||||||
|| nalType == GST_H265_NAL_SLICE_IDR_N_LP)) {
|
|| nal_type == GST_H265_NAL_SLICE_IDR_N_LP)) {
|
||||||
/* send VPS/SPS/PPS before every IDR frame */
|
/* send VPS/SPS/PPS before every IDR frame */
|
||||||
send_ps = TRUE;
|
send_ps = TRUE;
|
||||||
}
|
}
|
||||||
|
@ -1024,7 +1024,7 @@ gst_rtp_h265_pay_payload_nal (GstRTPBasePayload * basepayload,
|
||||||
ret = gst_rtp_base_payload_push_list (basepayload, outlist);
|
ret = gst_rtp_base_payload_push_list (basepayload, outlist);
|
||||||
} else {
|
} else {
|
||||||
/* fragmentation Units */
|
/* fragmentation Units */
|
||||||
guint limitedSize;
|
guint fragment_size;
|
||||||
int ii = 0, start = 1, end = 0, pos = 0;
|
int ii = 0, start = 1, end = 0, pos = 0;
|
||||||
|
|
||||||
GST_DEBUG_OBJECT (basepayload,
|
GST_DEBUG_OBJECT (basepayload,
|
||||||
|
@ -1042,10 +1042,10 @@ gst_rtp_h265_pay_payload_nal (GstRTPBasePayload * basepayload,
|
||||||
outlist = gst_buffer_list_new ();
|
outlist = gst_buffer_list_new ();
|
||||||
|
|
||||||
while (end == 0) {
|
while (end == 0) {
|
||||||
limitedSize = size < payload_len ? size : payload_len;
|
fragment_size = size < payload_len ? size : payload_len;
|
||||||
GST_DEBUG_OBJECT (basepayload,
|
GST_DEBUG_OBJECT (basepayload,
|
||||||
"Inside FU fragmentation limitedSize=%d iteration=%d", limitedSize,
|
"Inside FU fragmentation fragment_size=%d iteration=%d",
|
||||||
ii);
|
fragment_size, ii);
|
||||||
|
|
||||||
/* use buffer lists
|
/* use buffer lists
|
||||||
* create buffer without payload containing only the RTP header
|
* create buffer without payload containing only the RTP header
|
||||||
|
@ -1058,33 +1058,33 @@ gst_rtp_h265_pay_payload_nal (GstRTPBasePayload * basepayload,
|
||||||
GST_BUFFER_PTS (outbuf) = pts;
|
GST_BUFFER_PTS (outbuf) = pts;
|
||||||
payload = gst_rtp_buffer_get_payload (&rtp);
|
payload = gst_rtp_buffer_get_payload (&rtp);
|
||||||
|
|
||||||
if (limitedSize == size) {
|
if (fragment_size == size) {
|
||||||
GST_DEBUG_OBJECT (basepayload, "end size=%d iteration=%d", size, ii);
|
GST_DEBUG_OBJECT (basepayload, "end size=%d iteration=%d", size, ii);
|
||||||
end = 1;
|
end = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* PayloadHdr (type = 49) */
|
/* PayloadHdr (type = 49) */
|
||||||
payload[0] = (nalHeader[0] & 0x81) | (49 << 1);
|
payload[0] = (nal_header[0] & 0x81) | (49 << 1);
|
||||||
payload[1] = nalHeader[1];
|
payload[1] = nal_header[1];
|
||||||
|
|
||||||
/* If it's the last fragment and the end of this au, mark the end of
|
/* If it's the last fragment and the end of this au, mark the end of
|
||||||
* slice */
|
* slice */
|
||||||
gst_rtp_buffer_set_marker (&rtp, end && marker);
|
gst_rtp_buffer_set_marker (&rtp, end && marker);
|
||||||
|
|
||||||
/* FU Header */
|
/* FU Header */
|
||||||
payload[2] = (start << 7) | (end << 6) | (nalType & 0x3f);
|
payload[2] = (start << 7) | (end << 6) | (nal_type & 0x3f);
|
||||||
|
|
||||||
gst_rtp_buffer_unmap (&rtp);
|
gst_rtp_buffer_unmap (&rtp);
|
||||||
|
|
||||||
/* insert payload memory block */
|
/* insert payload memory block */
|
||||||
gst_rtp_copy_video_meta (rtph265pay, outbuf, paybuf);
|
gst_rtp_copy_video_meta (rtph265pay, outbuf, paybuf);
|
||||||
gst_buffer_copy_into (outbuf, paybuf, GST_BUFFER_COPY_MEMORY, pos,
|
gst_buffer_copy_into (outbuf, paybuf, GST_BUFFER_COPY_MEMORY, pos,
|
||||||
limitedSize);
|
fragment_size);
|
||||||
/* add the buffer to the buffer list */
|
/* add the buffer to the buffer list */
|
||||||
gst_buffer_list_add (outlist, outbuf);
|
gst_buffer_list_add (outlist, outbuf);
|
||||||
|
|
||||||
size -= limitedSize;
|
size -= fragment_size;
|
||||||
pos += limitedSize;
|
pos += fragment_size;
|
||||||
ii++;
|
ii++;
|
||||||
start = 0;
|
start = 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue