~ubuntu-branches/ubuntu/intrepid/gpac/intrepid-proposed

« back to all changes in this revision

Viewing changes to applications/testapps/beng_test/CmdLineTst.c

  • Committer: Bazaar Package Importer
  • Author(s): John Dong
  • Date: 2007-01-24 23:34:57 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20070124233457-zzlls8afkt0nyakj
Tags: 0.4.2~rc2-0ubuntu1
* New upstream release
  * Most notably MP4 tagging support via MP4Box -itags
* debian/patches/01_64bits.dpatch: dropped; included upstream.

Show diffs side-by-side

added added

removed removed

Lines of Context:
11
11
        int i;
12
12
        GF_BifsEngine *codec1 = NULL;
13
13
        GF_BifsEngine * codec2 = NULL;
14
 
        if (1) {
 
14
        if (0) {
15
15
                char *config;
16
16
                u32 config_size;
17
17
                char update[] = "\n AT \n 500 \n { \n REPLACE \n M.emissiveColor BY 1 0 0 } \n";
18
18
 
19
 
                codec1 = gf_beng_init(NULL, argv[1], NULL);
20
 
                gf_beng_get_stream_config(codec1, &config, &config_size);
21
 
                fprintf(stdout, "EncodedBifsConfig size is %d \n", config_size);
22
 
 
23
 
                gf_beng_encode_context(codec1, SampleCallBack, NULL);
24
 
                gf_beng_save_context(codec1, "initial_context.mp4", NULL);
25
 
                gf_beng_encode_from_string(codec1, (char *) update, SampleCallBack, NULL);
26
 
                gf_beng_save_context(codec1, "non_aggregated_context.mp4", NULL);
27
 
                gf_beng_aggregate_context(codec1, NULL);
28
 
                gf_beng_save_context(codec1, "aggregated_context.mp4", NULL);
 
19
                codec1 = gf_beng_init(NULL, argv[1]);
 
20
                gf_beng_get_stream_config(codec1, &config, &config_size);
 
21
                fprintf(stdout, "EncodedBifsConfig size is %d \n", config_size);
 
22
 
 
23
                gf_beng_encode_context(codec1, SampleCallBack);
 
24
                gf_beng_save_context(codec1, "initial_context.mp4");
 
25
                gf_beng_encode_from_string(codec1, (char *) update, SampleCallBack);
 
26
                gf_beng_save_context(codec1, "non_aggregated_context.mp4");
 
27
                gf_beng_aggregate_context(codec1);
 
28
                gf_beng_save_context(codec1, "aggregated_context.mp4");
 
29
                gf_beng_terminate(codec1);
 
30
        } else if (1) {
 
31
                char *config;
 
32
                u32 config_size;
 
33
                char scene[] = "OrderedGroup {children [Background2D {backColor 1 1 1}Shape {appearance Appearance {material DEF M Material2D {emissiveColor 0 0 1 filled TRUE } } geometry Rectangle { size 100 75 } } ] }";
 
34
                char update[] = "\n AT \n 500 \n { \n REPLACE \n M.emissiveColor BY 1 0 0 \n REPLACE \n M.filled BY FALSE} \n";
 
35
 
 
36
                codec1 = gf_beng_init_from_string(NULL, scene, 200, 200, 1);
 
37
                gf_beng_get_stream_config(codec1, &config, &config_size);
 
38
                fprintf(stdout, "EncodedBifsConfig size is %d \n", config_size);
 
39
 
 
40
                gf_beng_encode_context(codec1, SampleCallBack);
 
41
                gf_beng_save_context(codec1, "initial_context.mp4");
 
42
                gf_beng_encode_from_string(codec1, (char *) update, SampleCallBack);
 
43
                gf_beng_save_context(codec1, "non_aggregated_context.mp4");
 
44
                gf_beng_aggregate_context(codec1);
 
45
                gf_beng_save_context(codec1, "aggregated_context.mp4");
29
46
                gf_beng_terminate(codec1);
30
47
        } else {
31
48
 
45
62
                                strcpy(in_context, "rect.bt");
46
63
                        }
47
64
 
48
 
                        codec2 = gf_beng_init(NULL, in_context, NULL);
 
65
                        codec2 = gf_beng_init(NULL, in_context);
49
66
 
50
67
                        sprintf(timed_update, "AT %i { %s }", 1000 + i, update);
51
68
                        
52
 
                        gf_beng_encode_from_string(codec2, timed_update, SampleCallBack, NULL);
 
69
                        gf_beng_encode_from_string(codec2, timed_update, SampleCallBack);
53
70
 
54
71
                        sprintf(mp4_out_na_context, "na_%s_%i.mp4", context_rootname, i+1);
55
72
                        sprintf(bt_out_na_context, "na_%s_%i.bt", context_rootname, i+1);
56
73
                        sprintf(mp4_out_agg_context, "agg_%s_%i.mp4", context_rootname, i+1);
57
74
                        sprintf(bt_out_agg_context, "agg_%s_%i.bt", context_rootname, i+1);
58
75
 
59
 
                        gf_beng_save_context(codec2, mp4_out_na_context, NULL);
60
 
                        gf_beng_save_context(codec2, bt_out_na_context, NULL);
61
 
                        gf_beng_aggregate_context(codec2, NULL);
62
 
                        gf_beng_save_context(codec2, mp4_out_agg_context, NULL);
63
 
                        gf_beng_save_context(codec2, bt_out_agg_context, NULL);
 
76
                        gf_beng_save_context(codec2, mp4_out_na_context);
 
77
                        gf_beng_save_context(codec2, bt_out_na_context);
 
78
                        gf_beng_aggregate_context(codec2);
 
79
                        gf_beng_save_context(codec2, mp4_out_agg_context);
 
80
                        gf_beng_save_context(codec2, bt_out_agg_context);
64
81
                
65
82
                        gf_beng_terminate(codec2);
66
83
                }