资源简介
实现将已经成流的H264数据发送到网络(根据示testH264VideoStreamer.cpp修改),
一个线程将H264数据从文件中读取出来放到缓存
live555服务器不停地从缓存中获取数据
live555广播出去
代码片段和文件信息
/**********
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 3 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-2018 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) fN
相关资源
- 从零开始学习音视频编程技术41 H.26
-
H264Pla
yer41H.264播放器.zip - live555-20181214基于ARM-linux从网络摄像机
- H.264 (H264)文件800_600.264,分辨率8
- H264_H265分析工具StreamEye3.1.0 HEVC-Anal
- 海康webcomponents最新版64位,32位(内附
- h.264在fpga上的实现
- D1_20170926111430_1701_1.h264
- 从零开始学习音视频编程技术41 H.26
- vs2013 live555流媒体服务 直播点播编译
- QT显示解码h264文件显示视频
- Qt实现RTSP视频流播放器
- Qt基于ffmpeg的rtsp视频流接收播放工具
- 从零开始学习音视频编程技术十六 采
- easystream
- portSpirit.zip
- Streamedian WS RTSP Proxy Server 1.8.5.exe
- RTSP流接收实时解码保存视频帧图像
- RTMP推流RTSP视频
- 基于live555实现的rtsp点播客户端,并将
- Easydarwin的RTSP和RTMP视频流媒体服务的
- Live555_2017-vs2015 x64 x86 完全编译版本(
- flv解析h264
- h5stream安装程序与API中文手册-rtmprts
- 使用DirectShow采集摄像头并对视音频进
- 国标28181转rtsp/rtmp/webrtc/hls/flv
- 海康大华RTSP转HLS
-
Ijkpla
yer rtsp http 播放 - ffmpeg nvdia硬解封装GPU实现NV12-RGBA
- 视频分析工具H264Visa
评论
共有 条评论