-
Notifications
You must be signed in to change notification settings - Fork 1
/
test.c
74 lines (66 loc) · 1.85 KB
/
test.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
/*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at https://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is MPEG4IP.
*
* The Initial Developer of the Original Code is Cisco Systems Inc.
* Portions created by Cisco Systems Inc. are
* Copyright (C) Cisco Systems Inc. 2000, 2001. All Rights Reserved.
*
* Contributor(s):
* Bill May [email protected]
*/
/*
* test.c - test utility for sdp library
*/
#include "mpeg4ip.h"
#include <time.h>
#include "sdp.h"
#include "mpeg4ip_utils.h"
int main (int argc, char **argv)
{
sdp_decode_info_t *sdpd;
session_desc_t *session;
int err;
int num_translated;
char *formatted;
argc--;
argv++;
if (argc == 0) {
printf("No arguments specified\n");
exit(1);
}
sdp_set_loglevel(LOG_DEBUG);
sdp_set_error_func(library_message);
sdpd = set_sdp_decode_from_filename(*argv);
if (sdpd == NULL) {
printf("Didn't find file %s\n", *argv);
exit(1);
}
err = sdp_decode(sdpd, &session, &num_translated);
if (err != 0) {
printf("couldn't decode it - error code is %d - number %d\n", err,
num_translated + 1);
}
if (num_translated != 0) {
session_dump_list(session);
err = sdp_encode_list_to_memory(session, &formatted, NULL);
if (err == 0) {
printf("%s\n", formatted);
} else {
printf("Error formating session %d\n", err);
}
free(formatted);
sdp_free_session_desc(session);
}
sdp_decode_info_free(sdpd);
return (0);
}