2
* The contents of this file are subject to the Mozilla Public
3
* License Version 1.1 (the "License"); you may not use this file
4
* except in compliance with the License. You may obtain a copy of
5
* the License at http://www.mozilla.org/MPL/
7
* Software distributed under the License is distributed on an "AS
8
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
9
* implied. See the License for the specific language governing
10
* rights and limitations under the License.
12
* The Original Code is MPEG4IP.
14
* The Initial Developer of the Original Code is Cisco Systems Inc.
15
* Portions created by Cisco Systems Inc. are
16
* Copyright (C) Cisco Systems Inc. 2000, 2001. All Rights Reserved.
19
* Dave Mackie dmackie@cisco.com
22
#include "quicktime.h"
25
int quicktime_rtp_init(quicktime_rtp_t *rtp)
30
int quicktime_rtp_set(quicktime_rtp_t *rtp, char *string)
34
rtp->string = malloc(strlen(string) + 1);
35
strcpy(rtp->string, string);
41
int quicktime_rtp_append(quicktime_rtp_t *rtp, char *appendString)
43
char* newString = malloc(strlen(rtp->string) + strlen(appendString) + 1);
45
strcpy(newString, rtp->string);
46
strcat(newString, appendString);
48
rtp->string = newString;
51
int quicktime_rtp_delete(quicktime_rtp_t *rtp)
56
int quicktime_rtp_dump(quicktime_rtp_t *rtp)
59
printf(" string %s\n", rtp->string);
62
int quicktime_read_rtp(quicktime_t *file, quicktime_rtp_t *rtp,
63
quicktime_atom_t* rtp_atom)
65
int rtpLen = rtp_atom->size - 12;
67
rtp->string = malloc(rtpLen + 1);
68
quicktime_read_int32(file); // skip the 'sdp '
69
quicktime_read_data(file, rtp->string, rtpLen);
70
rtp->string[rtpLen] = '\0';
73
int quicktime_write_rtp(quicktime_t *file, quicktime_rtp_t *rtp)
76
quicktime_atom_t atom;
78
if (rtp->string == NULL) {
82
quicktime_atom_write_header(file, &atom, "rtp ");
84
quicktime_write_data(file, "sdp ", 4);
85
quicktime_write_data(file, rtp->string, strlen(rtp->string));
87
quicktime_atom_write_footer(file, &atom);