摄像头推流到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-masterREADME.md
     目录           0  2017-02-18 16:47  JpegRtspCamera-masterlive
     目录           0  2017-02-18 16:47  JpegRtspCamera-masterliveBasicUsageEnvironment
     文件        7664  2017-02-18 16:47  JpegRtspCamera-masterliveBasicUsageEnvironmentBasicHashTable.cpp
     文件       10537  2017-02-18 16:47  JpegRtspCamera-masterliveBasicUsageEnvironmentBasicTaskScheduler.cpp
     文件        7512  2017-02-18 16:47  JpegRtspCamera-masterliveBasicUsageEnvironmentBasicTaskScheduler0.cpp
     文件        2437  2017-02-18 16:47  JpegRtspCamera-masterliveBasicUsageEnvironmentBasicUsageEnvironment.cpp
     文件        2622  2017-02-18 16:47  JpegRtspCamera-masterliveBasicUsageEnvironmentBasicUsageEnvironment0.cpp
     文件       24389  2017-02-18 16:47  JpegRtspCamera-masterliveBasicUsageEnvironmentCOPYING
     文件        6421  2017-02-18 16:47  JpegRtspCamera-masterliveBasicUsageEnvironmentDelayQueue.cpp
     文件         166  2017-02-18 16:47  JpegRtspCamera-masterliveBasicUsageEnvironmentMakefile.head
     文件        1703  2017-02-18 16:47  JpegRtspCamera-masterliveBasicUsageEnvironmentMakefile.tail
     目录           0  2017-02-18 16:47  JpegRtspCamera-masterliveBasicUsageEnvironmentinclude
     文件        3475  2017-02-18 16:47  JpegRtspCamera-masterliveBasicUsageEnvironmentincludeBasicHashTable.hh
     文件        3196  2017-02-18 16:47  JpegRtspCamera-masterliveBasicUsageEnvironmentincludeBasicUsageEnvironment.hh
     文件        3712  2017-02-18 16:47  JpegRtspCamera-masterliveBasicUsageEnvironmentincludeBasicUsageEnvironment0.hh
     文件         354  2017-02-18 16:47  JpegRtspCamera-masterliveBasicUsageEnvironmentincludeBasicUsageEnvironment_version.hh
     文件        4656  2017-02-18 16:47  JpegRtspCamera-masterliveBasicUsageEnvironmentincludeDelayQueue.hh
     文件        2195  2017-02-18 16:47  JpegRtspCamera-masterliveBasicUsageEnvironmentincludeHandlerSet.hh
     文件       24389  2017-02-18 16:47  JpegRtspCamera-masterliveCOPYING
     文件          49  2017-02-18 16:47  JpegRtspCamera-masterliveMakefile.head
     文件        1387  2017-02-18 16:47  JpegRtspCamera-masterliveMakefile.tail
     文件         103  2017-02-18 16:47  JpegRtspCamera-masterliveREADME
     目录           0  2017-02-18 16:47  JpegRtspCamera-masterliveUsageEnvironment
     文件       24389  2017-02-18 16:47  JpegRtspCamera-masterliveUsageEnvironmentCOPYING
     文件        1428  2017-02-18 16:47  JpegRtspCamera-masterliveUsageEnvironmentHashTable.cpp
     文件         136  2017-02-18 16:47  JpegRtspCamera-masterliveUsageEnvironmentMakefile.head
     文件        1281  2017-02-18 16:47  JpegRtspCamera-masterliveUsageEnvironmentMakefile.tail
     文件        2086  2017-02-18 16:47  JpegRtspCamera-masterliveUsageEnvironmentUsageEnvironment.cpp
     目录           0  2017-02-18 16:47  JpegRtspCamera-masterliveUsageEnvironmentinclude
............此处省略494个文件信息

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件举报,一经查实,本站将立刻删除。

发表评论

评论列表(条)