Lines Matching full:args

60 static u32 vidtv_pes_write_header_stuffing(struct pes_header_write_args *args)  in vidtv_pes_write_header_stuffing()  argument
68 if (args->n_pes_h_s_bytes > PES_HEADER_MAX_STUFFING_BYTES) { in vidtv_pes_write_header_stuffing()
71 args->n_pes_h_s_bytes = PES_HEADER_MAX_STUFFING_BYTES; in vidtv_pes_write_header_stuffing()
74 return vidtv_memset(args->dest_buf, in vidtv_pes_write_header_stuffing()
75 args->dest_offset, in vidtv_pes_write_header_stuffing()
76 args->dest_buf_sz, in vidtv_pes_write_header_stuffing()
78 args->n_pes_h_s_bytes); in vidtv_pes_write_header_stuffing()
81 static u32 vidtv_pes_write_pts_dts(struct pes_header_write_args *args) in vidtv_pes_write_pts_dts() argument
93 if (!args->send_pts && args->send_dts) in vidtv_pes_write_pts_dts()
101 if (args->send_pts && args->send_dts) { in vidtv_pes_write_pts_dts()
102 pts_dts.pts1 = (0x3 << 4) | ((args->pts & mask1) >> 29) | 0x1; in vidtv_pes_write_pts_dts()
103 pts_dts.pts2 = cpu_to_be16(((args->pts & mask2) >> 14) | 0x1); in vidtv_pes_write_pts_dts()
104 pts_dts.pts3 = cpu_to_be16(((args->pts & mask3) << 1) | 0x1); in vidtv_pes_write_pts_dts()
106 pts_dts.dts1 = (0x1 << 4) | ((args->dts & mask1) >> 29) | 0x1; in vidtv_pes_write_pts_dts()
107 pts_dts.dts2 = cpu_to_be16(((args->dts & mask2) >> 14) | 0x1); in vidtv_pes_write_pts_dts()
108 pts_dts.dts3 = cpu_to_be16(((args->dts & mask3) << 1) | 0x1); in vidtv_pes_write_pts_dts()
113 } else if (args->send_pts) { in vidtv_pes_write_pts_dts()
114 pts.pts1 = (0x1 << 5) | ((args->pts & mask1) >> 29) | 0x1; in vidtv_pes_write_pts_dts()
115 pts.pts2 = cpu_to_be16(((args->pts & mask2) >> 14) | 0x1); in vidtv_pes_write_pts_dts()
116 pts.pts3 = cpu_to_be16(((args->pts & mask3) << 1) | 0x1); in vidtv_pes_write_pts_dts()
123 nbytes += vidtv_memcpy(args->dest_buf, in vidtv_pes_write_pts_dts()
124 args->dest_offset + nbytes, in vidtv_pes_write_pts_dts()
125 args->dest_buf_sz, in vidtv_pes_write_pts_dts()
132 static u32 vidtv_pes_write_h(struct pes_header_write_args *args) in vidtv_pes_write_h() argument
139 u32 stream_id = (args->encoder_id == S302M) ? PRIVATE_STREAM_1_ID : args->stream_id; in vidtv_pes_write_h()
144 pes_header.length = cpu_to_be16(vidtv_pes_op_get_len(args->send_pts, in vidtv_pes_write_h()
145 args->send_dts) + in vidtv_pes_write_h()
146 args->access_unit_len); in vidtv_pes_write_h()
148 if (args->send_pts && args->send_dts) in vidtv_pes_write_h()
150 else if (args->send_pts) in vidtv_pes_write_h()
154 pes_optional.length = vidtv_pes_op_get_len(args->send_pts, args->send_dts) + in vidtv_pes_write_h()
155 args->n_pes_h_s_bytes - in vidtv_pes_write_h()
159 nbytes += vidtv_memcpy(args->dest_buf, in vidtv_pes_write_h()
160 args->dest_offset + nbytes, in vidtv_pes_write_h()
161 args->dest_buf_sz, in vidtv_pes_write_h()
166 nbytes += vidtv_memcpy(args->dest_buf, in vidtv_pes_write_h()
167 args->dest_offset + nbytes, in vidtv_pes_write_h()
168 args->dest_buf_sz, in vidtv_pes_write_h()
173 pts_dts_args = *args; in vidtv_pes_write_h()
174 pts_dts_args.dest_offset = args->dest_offset + nbytes; in vidtv_pes_write_h()
178 nbytes += vidtv_pes_write_header_stuffing(args); in vidtv_pes_write_h()
207 static u32 vidtv_pes_write_stuffing(struct pes_ts_header_write_args *args, in vidtv_pes_write_stuffing() argument
215 if (!args->n_stuffing_bytes) in vidtv_pes_write_stuffing()
227 stuff_nbytes = args->n_stuffing_bytes - ts_adap.length; in vidtv_pes_write_stuffing()
237 nbytes += vidtv_memcpy(args->dest_buf, in vidtv_pes_write_stuffing()
239 args->dest_buf_sz, in vidtv_pes_write_stuffing()
245 nbytes += vidtv_pes_write_pcr_bits(args->dest_buf, in vidtv_pes_write_stuffing()
247 args->pcr); in vidtv_pes_write_stuffing()
249 *last_pcr = args->pcr; in vidtv_pes_write_stuffing()
254 nbytes += vidtv_memset(args->dest_buf, in vidtv_pes_write_stuffing()
256 args->dest_buf_sz, in vidtv_pes_write_stuffing()
265 if (nbytes != args->n_stuffing_bytes) in vidtv_pes_write_stuffing()
267 nbytes, args->n_stuffing_bytes); in vidtv_pes_write_stuffing()
272 static u32 vidtv_pes_write_ts_h(struct pes_ts_header_write_args args, in vidtv_pes_write_ts_h() argument
278 u16 payload_start = !args.wrote_pes_header; in vidtv_pes_write_ts_h()
281 ts_header.bitfield = cpu_to_be16((payload_start << 14) | args.pid); in vidtv_pes_write_ts_h()
283 ts_header.adaptation_field = (args.n_stuffing_bytes) > 0; in vidtv_pes_write_ts_h()
284 ts_header.payload = (args.n_stuffing_bytes) < PES_TS_HEADER_MAX_STUFFING_BYTES; in vidtv_pes_write_ts_h()
286 ts_header.continuity_counter = *args.continuity_counter; in vidtv_pes_write_ts_h()
288 vidtv_ts_inc_cc(args.continuity_counter); in vidtv_pes_write_ts_h()
291 nbytes += vidtv_memcpy(args.dest_buf, in vidtv_pes_write_ts_h()
292 args.dest_offset + nbytes, in vidtv_pes_write_ts_h()
293 args.dest_buf_sz, in vidtv_pes_write_ts_h()
298 nbytes += vidtv_pes_write_stuffing(&args, args.dest_offset + nbytes, in vidtv_pes_write_ts_h()
304 u32 vidtv_pes_write_into(struct pes_write_args *args) in vidtv_pes_write_into() argument
306 u32 unaligned_bytes = (args->dest_offset % TS_PACKET_LEN); in vidtv_pes_write_into()
308 .dest_buf = args->dest_buf, in vidtv_pes_write_into()
309 .dest_buf_sz = args->dest_buf_sz, in vidtv_pes_write_into()
310 .pid = args->pid, in vidtv_pes_write_into()
311 .pcr = args->pcr, in vidtv_pes_write_into()
312 .continuity_counter = args->continuity_counter, in vidtv_pes_write_into()
315 .dest_buf = args->dest_buf, in vidtv_pes_write_into()
316 .dest_buf_sz = args->dest_buf_sz, in vidtv_pes_write_into()
317 .encoder_id = args->encoder_id, in vidtv_pes_write_into()
318 .send_pts = args->send_pts, in vidtv_pes_write_into()
319 .pts = args->pts, in vidtv_pes_write_into()
320 .send_dts = args->send_dts, in vidtv_pes_write_into()
321 .dts = args->dts, in vidtv_pes_write_into()
322 .stream_id = args->stream_id, in vidtv_pes_write_into()
323 .n_pes_h_s_bytes = args->n_pes_h_s_bytes, in vidtv_pes_write_into()
324 .access_unit_len = args->access_unit_len, in vidtv_pes_write_into()
326 u32 remaining_len = args->access_unit_len; in vidtv_pes_write_into()
328 u64 last_pcr = args->pcr; in vidtv_pes_write_into()
339 nbytes += vidtv_memset(args->dest_buf, in vidtv_pes_write_into()
340 args->dest_offset + nbytes, in vidtv_pes_write_into()
341 args->dest_buf_sz, in vidtv_pes_write_into()
354 available_space -= vidtv_pes_h_get_len(args->send_pts, in vidtv_pes_write_into()
355 args->send_dts); in vidtv_pes_write_into()
361 available_space -= args->n_pes_h_s_bytes; in vidtv_pes_write_into()
396 ts_header_args.dest_offset = args->dest_offset + nbytes; in vidtv_pes_write_into()
407 pes_header_args.dest_offset = args->dest_offset + in vidtv_pes_write_into()
414 nbytes += vidtv_memcpy(args->dest_buf, in vidtv_pes_write_into()
415 args->dest_offset + nbytes, in vidtv_pes_write_into()
416 args->dest_buf_sz, in vidtv_pes_write_into()
417 args->from, in vidtv_pes_write_into()
420 args->from += payload_size; in vidtv_pes_write_into()