• 大小: 1.11MB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2023-11-07
  • 语言: 其他
  • 标签: 推流rtmp  

资源简介

推流到rtmp,使用opencv摄像头输入,FFMPEG编码,推流到nginx-RTMP服务器,形成直播系统,opencv处理图像很强,可以方便加入各种特效。

资源截图

代码片段和文件信息

/**********
This library is free software; you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the
Free Software Foundation; either version 2.1 of the License or (at your
option) any later version. (See .)

This library is distributed in the hope that it will be useful but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for
more details.

You should have received a copy of the GNU Lesser General Public License
along with this library; if not write to the Free Software Foundation Inc.
51 Franklin Street Fifth Floor Boston MA 02110-1301  USA
**********/
// Copyright (c) 1996-2015 Live Networks Inc.  All rights reserved.
// Basic Hash Table implementation
// Implementation

#include “BasicHashTable.hh“
#include “strDup.hh“

#if defined(__WIN32__) || defined(_WIN32)
#else
#include 
#endif
#include 
#include 

// When there are this many entries per bucket on average rebuild
// the table to increase the number of buckets
#define REBUILD_MULTIPLIER 3

BasicHashTable::BasicHashTable(int keyType)
  : fBuckets(fStaticBuckets) fNumBuckets(SMALL_HASH_TABLE_SIZE)
    fNumEntries(0) fRebuildSize(SMALL_HASH_TABLE_SIZE*REBUILD_MULTIPLIER)
    fDownShift(28) fMask(0x3) fKeyType(keyType) {
  for (unsigned i = 0; i < SMALL_HASH_TABLE_SIZE; ++i) {
    fStaticBuckets[i] = NULL;
  }
}

BasicHashTable::~BasicHashTable() {
  // Free all the entries in the table:
  for (unsigned i = 0; i < fNumBuckets; ++i) {
    TableEntry* entry;
    while ((entry = fBuckets[i]) != NULL) {
      deleteEntry(i entry);
    }
  }

  // Also free the bucket array if it was dynamically allocated:
  if (fBuckets != fStaticBuckets) delete[] fBuckets;
}

void* BasicHashTable::Add(char const* key void* value) {
  void* oldValue;
  unsigned index;
  TableEntry* entry = lookupKey(key index);
  if (entry != NULL) {
    // There‘s already an item with this key
    oldValue = entry->value;
  } else {
    // There‘s no existing entry; create a new one:
    entry = insertNewEntry(index key);
    oldValue = NULL;
  }
  entry->value = value;

  // If the table has become too large rebuild it with more buckets:
  if (fNumEntries >= fRebuildSize) rebuild();

  return oldValue;
}

Boolean BasicHashTable::Remove(char const* key) {
  unsigned index;
  TableEntry* entry = lookupKey(key index);
  if (entry == NULL) return False; // no such entry

  deleteEntry(index entry);

  return True;
}

void* BasicHashTable::Lookup(char const* key) const {
  unsigned index;
  TableEntry* entry = lookupKey(key index);
  if (entry == NULL) return NULL; // no such entry

  return entry->value;
}

unsigned BasicHashTable::numEntries() const {
  return fNumEntries;
}

BasicHashTable::Iterator::Iterator(BasicHashTable const& table)
  : fTable(table) fNextIndex(0) 

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2017-02-18 16:47  JpegRtspCamera-master\
     文件        3178  2017-02-18 16:47  JpegRtspCamera-master\README.md
     目录           0  2017-02-18 16:47  JpegRtspCamera-master\live\
     目录           0  2017-02-18 16:47  JpegRtspCamera-master\live\BasicUsageEnvironment\
     文件        7664  2017-02-18 16:47  JpegRtspCamera-master\live\BasicUsageEnvironment\BasicHashTable.cpp
     文件       10537  2017-02-18 16:47  JpegRtspCamera-master\live\BasicUsageEnvironment\BasicTaskScheduler.cpp
     文件        7512  2017-02-18 16:47  JpegRtspCamera-master\live\BasicUsageEnvironment\BasicTaskScheduler0.cpp
     文件        2437  2017-02-18 16:47  JpegRtspCamera-master\live\BasicUsageEnvironment\BasicUsageEnvironment.cpp
     文件        2622  2017-02-18 16:47  JpegRtspCamera-master\live\BasicUsageEnvironment\BasicUsageEnvironment0.cpp
     文件       24389  2017-02-18 16:47  JpegRtspCamera-master\live\BasicUsageEnvironment\COPYING
     文件        6421  2017-02-18 16:47  JpegRtspCamera-master\live\BasicUsageEnvironment\DelayQueue.cpp
     文件         166  2017-02-18 16:47  JpegRtspCamera-master\live\BasicUsageEnvironment\Makefile.head
     文件        1703  2017-02-18 16:47  JpegRtspCamera-master\live\BasicUsageEnvironment\Makefile.tail
     目录           0  2017-02-18 16:47  JpegRtspCamera-master\live\BasicUsageEnvironment\include\
     文件        3475  2017-02-18 16:47  JpegRtspCamera-master\live\BasicUsageEnvironment\include\BasicHashTable.hh
     文件        3196  2017-02-18 16:47  JpegRtspCamera-master\live\BasicUsageEnvironment\include\BasicUsageEnvironment.hh
     文件        3712  2017-02-18 16:47  JpegRtspCamera-master\live\BasicUsageEnvironment\include\BasicUsageEnvironment0.hh
     文件         354  2017-02-18 16:47  JpegRtspCamera-master\live\BasicUsageEnvironment\include\BasicUsageEnvironment_version.hh
     文件        4656  2017-02-18 16:47  JpegRtspCamera-master\live\BasicUsageEnvironment\include\DelayQueue.hh
     文件        2195  2017-02-18 16:47  JpegRtspCamera-master\live\BasicUsageEnvironment\include\HandlerSet.hh
     文件       24389  2017-02-18 16:47  JpegRtspCamera-master\live\COPYING
     文件          49  2017-02-18 16:47  JpegRtspCamera-master\live\Makefile.head
     文件        1387  2017-02-18 16:47  JpegRtspCamera-master\live\Makefile.tail
     文件         103  2017-02-18 16:47  JpegRtspCamera-master\live\README
     目录           0  2017-02-18 16:47  JpegRtspCamera-master\live\UsageEnvironment\
     文件       24389  2017-02-18 16:47  JpegRtspCamera-master\live\UsageEnvironment\COPYING
     文件        1428  2017-02-18 16:47  JpegRtspCamera-master\live\UsageEnvironment\HashTable.cpp
     文件         136  2017-02-18 16:47  JpegRtspCamera-master\live\UsageEnvironment\Makefile.head
     文件        1281  2017-02-18 16:47  JpegRtspCamera-master\live\UsageEnvironment\Makefile.tail
     文件        2086  2017-02-18 16:47  JpegRtspCamera-master\live\UsageEnvironment\UsageEnvironment.cpp
     目录           0  2017-02-18 16:47  JpegRtspCamera-master\live\UsageEnvironment\include\
............此处省略494个文件信息

评论

共有 条评论