Esempio n. 1
0
        public static void WriteFooter(
            Stream strm, PiffManifest manifest,
            IEnumerable <PiffSampleOffsetV1> audioOffsets, IEnumerable <PiffSampleOffsetV1> videoOffsets)
        {
            var access = new PiffMovieFragmentRandomAccess(
                manifest.AudioTrackId, audioOffsets,
                manifest.VideoTrackId, videoOffsets);
            var mfraBytes = WriteBoxObject(access).ToArray();

            strm.Write(mfraBytes, 0, mfraBytes.Length);
        }
Esempio n. 2
0
        public static void WriteHeader(Stream strm, PiffManifest manifest)
        {
            var movie = new PiffMovieMetadata(manifest);

            var ftypBytes = WriteBoxObject(new PiffFileType()).ToArray();

            strm.Write(ftypBytes, 0, ftypBytes.Length);

            var hdrBytes = WriteBoxObject(movie).ToArray();

            strm.Write(hdrBytes, 0, hdrBytes.Length);
        }
Esempio n. 3
0
        public PiffMovieMetadata(PiffManifest manifest)
        {
            var maxDuration = Math.Max(manifest.Audio.Duration, manifest.Video.Duration);

            MovieHeader = new PiffMovieHeader(manifest.Created, maxDuration, manifest.TimeScale);

            ProtectionHeader = new PiffProtectionInfo(
                manifest.ProtectionSystemId, manifest.ProtectionData);

            AudioTrack = PiffTrack.CreateAudio(
                manifest.AudioTrackId, manifest.Audio, manifest.Created, manifest.TimeScale, manifest.KeyIdentifier);

            VideoTrack = PiffTrack.CreateVideo(
                manifest.VideoTrackId, manifest.Video, manifest.Created, manifest.TimeScale, manifest.KeyIdentifier);

            Extended = new PiffMovieExtended(maxDuration);
        }