Lines Matching defs:Cluster
1425 // Cluster class
1427 Cluster::Cluster(uint64 timecode, int64 cues_pos)
1437 Cluster::~Cluster() {}
1439 bool Cluster::Init(IMkvWriter* ptr_writer) {
1447 bool Cluster::AddFrame(const uint8* frame, uint64 length, uint64 track_number,
1453 bool Cluster::AddFrameWithAdditional(const uint8* frame, uint64 length,
1463 bool Cluster::AddFrameWithDiscardPadding(const uint8* frame, uint64 length,
1472 bool Cluster::AddMetadata(const uint8* frame, uint64 length,
1479 void Cluster::AddPayloadSize(uint64 size) { payload_size_ += size; }
1481 bool Cluster::Finalize() {
1503 uint64 Cluster::Size() const {
1510 bool Cluster::PreWriteBlock(Type* write_function) {
1525 void Cluster::PostWriteBlock(uint64 element_size) {
1530 bool Cluster::IsValidTrackNumber(uint64 track_number) const {
1534 int64 Cluster::GetRelativeTimecode(int64 abs_timecode) const {
1535 const int64 cluster_timecode = this->Cluster::timecode();
1545 bool Cluster::DoWriteBlock(const uint8* frame, uint64 length,
1570 bool Cluster::DoWriteBlockWithAdditional(
1598 bool Cluster::DoWriteBlockWithDiscardPadding(
1625 bool Cluster::WriteClusterHeader() {
1635 // Write "unknown" (EBML coded -1) as cluster size value. We need to write 8
1636 // bytes because we do not know how big our cluster will be.
1982 Cluster* const cluster = cluster_list_[i];
1983 delete cluster;
2021 cue_point->set_cluster_pos(cluster_pos); // update the new cluster position
2049 // of Cluster and Cues
2116 // Update last cluster's size
2117 Cluster* const old_cluster = cluster_list_[cluster_list_size_ - 1];
2233 const Cluster* const cluster = cluster_list_[cluster_list_size_ - 1];
2234 if (!cluster)
2242 cue->set_block_number(cluster->blocks_added());
2243 cue->set_cluster_pos(cluster->position_for_cues());
2281 // muxed into the same cluster.
2302 Cluster* const cluster = cluster_list_[cluster_list_size_ - 1];
2303 if (!cluster)
2309 if (!cluster->AddFrame(frame, length, track_number, abs_timecode, is_key))
2340 // muxed into the same cluster.
2361 Cluster* const cluster = cluster_list_[cluster_list_size_ - 1];
2362 if (cluster == NULL)
2368 if (!cluster->AddFrameWithAdditional(frame, length, additional,
2400 // muxed into the same cluster.
2422 Cluster* const cluster = cluster_list_[cluster_list_size_ - 1];
2423 if (!cluster)
2429 if (!cluster->AddFrameWithDiscardPadding(
2464 Cluster* const cluster = cluster_list_[cluster_list_size_ - 1];
2466 if (!cluster)
2473 if (!cluster->AddMetadata(frame, length, track_number, abs_timecode,
2660 // Here we are testing whether to create a new cluster, given a frame
2668 // If no clusters have been created yet, then create a new cluster
2669 // and write this frame immediately, in the new cluster. This path
2676 // There exists at least one cluster. We must compare the frame to
2677 // the last cluster, in order to determine whether the frame is
2678 // written to the existing cluster, or that a new cluster should be
2684 const Cluster* const last_cluster = cluster_list_[cluster_list_size_ - 1];
2688 // is less than the cluster's timecode. Although in principle that
2696 // cluster (in Matroska, cluster-relative timestamps are serialized
2698 // to that cluster, and so we must create a new cluster.
2705 // We decide to create a new cluster when we have a video keyframe.
2707 // immediately, in the newly-created cluster.
2712 // Create a new cluster if we have accumulated too many frames
2714 // in the cluster exceeds a threshold".
2722 // cluster is created when the size of the current cluster exceeds a
2730 // There's no need to create a new cluster, so emit this frame now.
2742 Cluster** const clusters =
2743 new (std::nothrow) Cluster* [new_capacity]; // NOLINT
2762 // Update old cluster's size
2763 Cluster* const old_cluster = cluster_list_[cluster_list_size_ - 1];
2797 Cluster*& cluster = cluster_list_[cluster_list_size_];
2799 cluster = new (std::nothrow) Cluster(cluster_timecode, offset); // NOLINT
2800 if (!cluster)
2803 if (!cluster->Init(writer_cluster_))
2814 // cluster, decide whether to create a new cluster.
2822 // A non-zero result means create a new cluster.
2831 // Write the current frame to the current cluster (if TestFrame
2832 // returns 0) or to a newly created cluster (TestFrame returns 1).
2837 // difference between the cluster and the frame itself. Do the
2838 // test again, comparing the frame to the new cluster.
2914 Cluster* const cluster = cluster_list_[i];
2915 offset += cluster->Size();
2960 Cluster* const cluster = cluster_list_[cluster_list_size_ - 1];
2962 if (!cluster)
2973 if (!cluster->AddFrameWithDiscardPadding(
2979 if (!cluster->AddFrame(frame->frame(), frame->length(),
3005 // Check |cluster_list_size_| to see if this is the first cluster. If it is
3006 // the first cluster the audio frames that are less than the first video
3012 Cluster* const cluster = cluster_list_[cluster_list_size_ - 1];
3013 if (!cluster)
3033 if (!cluster->AddFrameWithDiscardPadding(
3040 if (!cluster->AddFrame(frame_prev->frame(), frame_prev->length(),