| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright © 2010 Mozilla Foundation | 2 * Copyright © 2010 Mozilla Foundation |
| 3 * | 3 * |
| 4 * This program is made available under an ISC-style license. See the | 4 * This program is made available under an ISC-style license. See the |
| 5 * accompanying file LICENSE for details. | 5 * accompanying file LICENSE for details. |
| 6 */ | 6 */ |
| 7 #include <assert.h> | 7 #include <assert.h> |
| 8 #include <stdlib.h> | 8 #include <stdlib.h> |
| 9 #include <string.h> | 9 #include <string.h> |
| 10 | 10 |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 #define LACING_XIPH 1 | 120 #define LACING_XIPH 1 |
| 121 #define LACING_FIXED 2 | 121 #define LACING_FIXED 2 |
| 122 #define LACING_EBML 3 | 122 #define LACING_EBML 3 |
| 123 | 123 |
| 124 /* Track Types */ | 124 /* Track Types */ |
| 125 #define TRACK_TYPE_VIDEO 1 | 125 #define TRACK_TYPE_VIDEO 1 |
| 126 #define TRACK_TYPE_AUDIO 2 | 126 #define TRACK_TYPE_AUDIO 2 |
| 127 | 127 |
| 128 /* Track IDs */ | 128 /* Track IDs */ |
| 129 #define TRACK_ID_VP8 "V_VP8" | 129 #define TRACK_ID_VP8 "V_VP8" |
| 130 #define TRACK_ID_VP9 "V_VP9" |
| 130 #define TRACK_ID_VORBIS "A_VORBIS" | 131 #define TRACK_ID_VORBIS "A_VORBIS" |
| 131 | 132 |
| 132 enum vint_mask { | 133 enum vint_mask { |
| 133 MASK_NONE, | 134 MASK_NONE, |
| 134 MASK_FIRST_BIT | 135 MASK_FIRST_BIT |
| 135 }; | 136 }; |
| 136 | 137 |
| 137 struct ebml_binary { | 138 struct ebml_binary { |
| 138 unsigned char * data; | 139 unsigned char * data; |
| 139 size_t length; | 140 size_t length; |
| (...skipping 1522 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1662 entry = ne_find_track_entry(ctx, track); | 1663 entry = ne_find_track_entry(ctx, track); |
| 1663 if (!entry) | 1664 if (!entry) |
| 1664 return -1; | 1665 return -1; |
| 1665 | 1666 |
| 1666 if (ne_get_string(entry->codec_id, &codec_id) != 0) | 1667 if (ne_get_string(entry->codec_id, &codec_id) != 0) |
| 1667 return -1; | 1668 return -1; |
| 1668 | 1669 |
| 1669 if (strcmp(codec_id, TRACK_ID_VP8) == 0) | 1670 if (strcmp(codec_id, TRACK_ID_VP8) == 0) |
| 1670 return NESTEGG_CODEC_VP8; | 1671 return NESTEGG_CODEC_VP8; |
| 1671 | 1672 |
| 1673 if (strcmp(codec_id, TRACK_ID_VP9) == 0) |
| 1674 return NESTEGG_CODEC_VP9; |
| 1675 |
| 1672 if (strcmp(codec_id, TRACK_ID_VORBIS) == 0) | 1676 if (strcmp(codec_id, TRACK_ID_VORBIS) == 0) |
| 1673 return NESTEGG_CODEC_VORBIS; | 1677 return NESTEGG_CODEC_VORBIS; |
| 1674 | 1678 |
| 1675 return -1; | 1679 return -1; |
| 1676 } | 1680 } |
| 1677 | 1681 |
| 1678 int | 1682 int |
| 1679 nestegg_track_codec_data_count(nestegg * ctx, unsigned int track, | 1683 nestegg_track_codec_data_count(nestegg * ctx, unsigned int track, |
| 1680 unsigned int * count) | 1684 unsigned int * count) |
| 1681 { | 1685 { |
| (...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1929 *data = f->data; | 1933 *data = f->data; |
| 1930 *length = f->length; | 1934 *length = f->length; |
| 1931 return 0; | 1935 return 0; |
| 1932 } | 1936 } |
| 1933 count += 1; | 1937 count += 1; |
| 1934 f = f->next; | 1938 f = f->next; |
| 1935 } | 1939 } |
| 1936 | 1940 |
| 1937 return -1; | 1941 return -1; |
| 1938 } | 1942 } |
| OLD | NEW |