Lines Matching refs:frame

141 bool Frame::Init(const uint8* frame, uint64 length) {
151 memcpy(frame_, frame, static_cast<size_t>(length_));
1001 // for a frame using exactly 4 bytes.
1490 bool Cluster::AddFrame(const uint8* frame,
1495 return DoWriteBlock(frame,
1503 bool Cluster::AddFrameWithAdditional(const uint8* frame,
1511 return DoWriteBlockWithAdditional(frame,
1522 bool Cluster::AddFrameWithDiscardPadding(const uint8* frame,
1528 return DoWriteBlockWithDiscardPadding(frame,
1537 bool Cluster::AddMetadata(const uint8* frame,
1542 return DoWriteBlock(frame,
1620 const uint8* frame,
1626 if (frame == NULL || length == 0)
1640 frame,
1653 const uint8* frame,
1662 if (frame == NULL || length == 0 ||
1677 frame,
1693 const uint8* frame,
1700 if (frame == NULL || length == 0 || discard_padding <= 0)
1714 frame,
2101 Frame* const frame = frames_[i];
2102 delete frame;
2384 bool Segment::AddFrame(const uint8* frame,
2389 if (!frame)
2400 // audio that is associated with the start time of a video key-frame is
2404 if (new_frame == NULL || !new_frame->Init(frame, length))
2429 if (!cluster->AddFrame(frame,
2447 bool Segment::AddFrameWithAdditional(const uint8* frame,
2455 if (frame == NULL || additional == NULL)
2466 // audio that is associated with the start time of a video key-frame is
2470 if (new_frame == NULL || !new_frame->Init(frame, length))
2495 if (!cluster->AddFrameWithAdditional(frame,
2516 bool Segment::AddFrameWithDiscardPadding(const uint8* frame,
2522 if (frame == NULL || discard_padding <= 0)
2533 // audio that is associated with the start time of a video key-frame is
2537 if (new_frame == NULL || !new_frame->Init(frame, length))
2563 if (!cluster->AddFrameWithDiscardPadding(frame, length,
2582 bool Segment::AddMetadata(const uint8* frame,
2587 if (!frame)
2612 if (!cluster->AddMetadata(frame,
2625 bool Segment::AddGenericFrame(const Frame* frame) {
2626 last_block_duration_ = frame->duration();
2627 if (!tracks_.TrackIsAudio(frame->track_number()) &&
2628 !tracks_.TrackIsVideo(frame->track_number()) &&
2629 frame->duration() > 0) {
2630 return AddMetadata(frame->frame(),
2631 frame->length(),
2632 frame->track_number(),
2633 frame->timestamp(),
2634 frame->duration());
2635 } else if (frame->additional() && frame->additional_length() > 0) {
2636 return AddFrameWithAdditional(frame->frame(),
2637 frame->length(),
2638 frame->additional(),
2639 frame->additional_length(),
2640 frame->add_id(),
2641 frame->track_number(),
2642 frame->timestamp(),
2643 frame->is_key());
2644 } else if (frame->discard_padding() > 0) {
2645 return AddFrameWithDiscardPadding(frame->frame(), frame->length(),
2646 frame->discard_padding(),
2647 frame->track_number(),
2648 frame->timestamp(),
2649 frame->is_key());
2651 return AddFrame(frame->frame(),
2652 frame->length(),
2653 frame->track_number(),
2654 frame->timestamp(),
2655 frame->is_key());
2819 // Here we are testing whether to create a new cluster, given a frame
2829 // and write this frame immediately, in the new cluster. This path
2831 // a frame.
2836 // There exists at least one cluster. We must compare the frame to
2837 // the last cluster, in order to determine whether the frame is
2847 // For completeness we test for the case when the frame's timecode
2855 // If the frame has a timestamp significantly larger than the last
2857 // using a 16-bit signed integer), then we cannot write this frame
2890 // There's no need to create a new cluster, so emit this frame now.
2949 const Frame* const f = frames_[0]; // earliest queued frame
2974 // Based on the characteristics of the current frame and current
2992 // Write the current frame to the current cluster (if TestFrame
2998 // difference between the cluster and the frame itself. Do the
2999 // test again, comparing the frame to the new cluster.
3086 bool Segment::QueueFrame(Frame* frame) {
3109 frames_[frames_size_++] = frame;
3129 Frame*& frame = frames_[i];
3130 const uint64 frame_timestamp = frame->timestamp(); // ns
3133 if (frame->discard_padding() > 0) {
3134 if (!cluster->AddFrameWithDiscardPadding(frame->frame(),
3135 frame->length(),
3136 frame->discard_padding(),
3137 frame->track_number(),
3139 frame->is_key())) {
3143 if (!cluster->AddFrame(frame->frame(),
3144 frame->length(),
3145 frame->track_number(),
3147 frame->is_key())) {
3152 if (new_cuepoint_ && cues_track_ == frame->track_number()) {
3160 delete frame;
3161 frame = NULL;
3186 // the next frame's start time if the duration is accurate.
3199 if (!cluster->AddFrameWithDiscardPadding(frame_prev->frame(),
3208 if (!cluster->AddFrame(frame_prev->frame(),